Commit graph

6383 commits

Author SHA1 Message Date
joeduffy 78b2adc9fe Overhaul the stacks.md design document
The stacks.md document used to describe the metadata format.  Now that we've
moved away from the old model of YAML + Go templates, and created the MuPack/MuIL
format, this document needed to be overhauled.

It's pretty bare bones now, however it will eventually evolve into a document
describing how the Mu abstractions map down onto MuPack/MuIL concepts.  For example,
it describes how subclassing mu.Stack creates a "stack", even though at the MuPack/MuIL
level it's just any old subclass.
2017-01-01 18:06:03 -08:00
joeduffy 36ab7a8710 Add some out of date markers 2017-01-01 17:11:28 -08:00
joeduffy 0c2940ba0b Goodbye Mull2
Some say the world will end in fire,
Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice
Is also great
And would suffice.
2017-01-01 17:05:48 -08:00
joeduffy e451d64a71 Tidy up a few things, especially references to "resources" 2017-01-01 16:57:12 -08:00
joeduffy a2ca2c84af Flesh out the cross-cloud doc 2017-01-01 16:35:23 -08:00
joeduffy 7a502cb83a Flesh out a bunch of things 2017-01-01 16:17:30 -08:00
joeduffy 7d249894ee Freshen up the description of dependency management 2017-01-01 16:02:18 -08:00
joeduffy 1895753f53 Goodbye Mull
A Death blow is a Life blow to Some
Who till they died, did not alive become--
Who had they lived, had died but when
They died, Vitality begun.
2017-01-01 15:24:25 -08:00
joeduffy 67ca1a6cc4 Add a README pointer to the overview doc 2017-01-01 15:19:22 -08:00
joeduffy 1bd1aaf968 Reorganize documents a bit and add an index 2017-01-01 15:18:36 -08:00
joeduffy 8f820ce11f Rename languages.md to formats.md
And also wordsmith a bunch of the front matter.
2017-01-01 15:12:51 -08:00
joeduffy f42e2579f4 Bring the concepts section up to date 2017-01-01 14:39:26 -08:00
joeduffy d4d6f3e018 Update the targets table 2017-01-01 14:24:08 -08:00
joeduffy a1d21b0d73 Move most docs into a design subdirectory 2017-01-01 14:18:00 -08:00
joeduffy 1ffb120bb3 Add a placeholder for competetive landscape in overview doc 2017-01-01 14:17:36 -08:00
joeduffy 82135ab219 Add a paragraph about interpretation 2017-01-01 14:17:08 -08:00
joeduffy 36534145a5 Rename architecture.md to overview.md
...and also add some front matter about the Mu problem and solution statements.
2017-01-01 14:13:25 -08:00
joeduffy ca7023602a Make a few nit/todo/wordsmithing edits 2017-01-01 12:58:40 -08:00
joeduffy 9089718fcf Add some simple control flow transformations
This includes break, continue, and while, which are trivial.  It also
includes do/while, which requires a simple rewrite during the lowering,
since MuIL only supports the one simple kind of loop.
2016-12-31 14:53:37 -08:00
joeduffy 2c7bbde93f Add an Identifier node kind 2016-12-31 14:18:55 -08:00
joeduffy ba11d87704 Add transformations for literal expressions 2016-12-31 14:13:45 -08:00
joeduffy 864e02fb32 Add basic TypeScript AST transform traversal
This change mostly adds the scaffolding to be later filled in to perform
TypeScript AST lowering into the MuIL and MuPack formats.
2016-12-31 13:29:46 -08:00
joeduffy ce3f3b9469 Add a few missing statement kinds
This adds a few missing statement AST kinds:

* ReturnStatement to `return` from a function with an optional expression.

* ThrowStatement to `throw` an exception object.

* EmptyStatement to represent, well, a statement without anything to it.
2016-12-31 13:21:06 -08:00
joeduffy ad239d1cdf Fix some TSLint and compiler warnings 2016-12-31 12:33:10 -08:00
joeduffy 7fcb195366 Refactor and rearrange modules a bit
This change refactors a few things:

* Eliminate the `mujs.il` package; instead, introduce `mujs.ast`.

* Split `mujs.ast` into many different files, to organize things a
  little more cleanly into expressions, nodes, sources, and statements.

* Move most definitions from the `mujs.pack` package into `mujs.ast`,
  into the definitions file.  This ensures that all definitions are true
  AST nodes, meaning they will preserve source location information.
2016-12-31 12:22:22 -08:00
joeduffy 4de470af46 Add a compiler module
This change adds a simple compiler module that hosts TypeScript and
compiles a program.  The compile function takes a path and optional options
data structure; the path can be one of three things: 1) a path to a single `*.ts`
file, in which case it, and it alone, is compiled; 2) a path to a `tsconfig.json`
file, in which case it is loaded, parsed, and used to drive compilation just
like the `tsc` command line driver; or 3) a path to a directory containing a
`tsconfig.json` file, in which case it is discovered and used just like #2.

There is also a new command line driver that just blindly passes arguments to
this compiler API, and prints the results.  Next up, this will begin lowering and
transforming the resulting TypeScript AST to MuPack and MuIL.

Note that I've reorganized the source code slightly, so that instead of just
`src/*`, we now have `lib/*` for the library, `cmd/*` for any CLI drivers, and,
soon, `test/*` for test cases.
2016-12-31 11:23:20 -08:00
joeduffy 366648d1d4 Upgrade to latest TSLint, and compile cleanly 2016-12-31 11:16:36 -08:00
joeduffy a07a81f7dc Add a LabeledStatement for labeled jumps 2016-12-31 10:37:21 -08:00
joeduffy cf271bc2ac Change dynamic load key to expression
This needs to be a string-typed expression, but needn't be a literal.
2016-12-31 10:36:34 -08:00
joeduffy a2c376b9ed Implement the MuIL AST
This is an initial implementation of the MuIL AST.

The AST has been intentionally pared back to the bare essentials, leaving the
task of lowering to the higher level MetaMu compilers.  For example, there is
only a single conditional statement, a single looping construct, etc.

It is in the MuJS compiler package so that we can begin lowering TypeScript
ASTs to this format and serializing them.  We will need separate Go projections
of these shapes in order to deserialize and evaluate programs to produce MuGL
from within the runtime/evaluation engine.

I'm sure the shape of these things will need to change -- and there are a
handful of open questions -- however, this is a start...
2016-12-30 15:34:49 -08:00
joeduffy a8ea444a68 Add typed projections for package metadata 2016-12-30 11:40:54 -08:00
joeduffy 88b06e0816 Add a note on exceptions 2016-12-30 11:04:23 -08:00
joeduffy 55a2a2abce Articulate accessibility 2016-12-30 10:34:55 -08:00
joeduffy 5de6b89562 Give in to classical classes
This change adopts some standard aspects of classes, like statics, abstract,
and virtuals (sealing).  It also recognizes records and interfaces as explicit
annotations on classes (both of which can be called "conjurable"); they were
already being treated specially with respect to structural/duck conversions,
and I always hate inferring defining properties of types like this, since simple
edits can completely change the type's semantics and break consumers of it.
2016-12-30 09:48:32 -08:00
joeduffy 88a550f420 Make a statement about async/await 2016-12-29 21:07:48 -08:00
joeduffy b88ed913cc Whittle away at the open issues list 2016-12-29 18:19:38 -08:00
joeduffy cf432e2a8a Add overview of function types and conversions 2016-12-29 18:08:19 -08:00
joeduffy 056ba1acf9 Move away from records, embrace classes
Also add a section on primary properties and initialization.
2016-12-29 16:25:26 -08:00
joeduffy e130b157aa Add details on variables and functions 2016-12-29 15:27:52 -08:00
joeduffy 742e44ae47 Merge branch 'master' of github.com:marapongo/mu 2016-12-29 13:04:32 -08:00
joeduffy 21a23b86f9 Introducing MuPack and MuIL
This change articulates Mu's packaging format, MuPack, along with its
corresponding intermediate language and type system, MuIL.  This is very
much a work in progress.
2016-12-29 13:03:45 -08:00
Joe Duffy 22223db29b Add an "out of date" caution to the old language docs 2016-12-22 18:22:47 -08:00
joeduffy eb20e5fefd Add a work item to figure out MuGL graph queries
This tags the relevant TODO with the work item marapongo/mu#30.
2016-12-22 17:16:02 -08:00
joeduffy 4c39f44095 Add a section on resource providers 2016-12-22 17:12:19 -08:00
joeduffy 27529d5be5 Fix a few typos; clarify a few things 2016-12-22 16:31:25 -08:00
joeduffy d890d43663 Wordsmith the languages doc a bit more
This fixes up some grammar and readability things I noticed as reading.
2016-12-22 16:18:52 -08:00
joeduffy 8f351cddf5 Add references to other deterministic JS projects
...and wordsmith a few minor things I noticed.
2016-12-22 16:11:13 -08:00
joeduffy e864aa302f Mu languages, take three
This documents our latest thinking on Mu languages.  At a high level,
there are three classes of language at play:

1. Mu Metadata Languages (MuML): these are the high-level language
   subsets that a programmer uses to specify Mu modules, etc.  Examples
   include MuJS, MuPy, MuRu, and MyGo, each representing a deterministic
   subset of JavaScript, Python, Ruby, and Go, respectively.

2. Mu Intermediate Language (MuIL): this is the intermediate form that
   all of the above compile down to.  It is capable of representing
   computations like functions, conditionals, and basic expressions like
   string concatenation, etc.  This is fully statically analyzable and
   can be used to create deterministic plans and topology graphs.

3. Mu Graph Language (MuGL): this is the "final" form in which any Mu
   service topology is represented.  It never contains computations and
   is merely a metadata description of services-as-nodes, dependencies-as-
   edges, and all known properties.  In the planning form, it may contain
   "holes" because output properties aren't known until execution has
   occurred, while in the actual applied form, those holes have been
   plugged.  MuGLs can be diffed, and a MuGL can be generated from an
   existing live environment (for bootstrapping and/or drift analysis).

There are several TODOs in here, but this is braindump of where we're at.
2016-12-22 15:40:35 -08:00
joeduffy 271d30e895 Flesh out details on basic stuff 2016-12-16 13:35:59 -08:00
joeduffy 97f5f54fd0 Update the library mu examples to the latest 2016-12-16 11:23:37 -08:00