Commit graph

419 commits

Author SHA1 Message Date
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
joeduffy 95534eb911 Rename "ctor()" to "new()"
And also eliminate funcs {} block in favor of simply func definitions.
2016-12-16 11:16:26 -08:00
joeduffy 6a23300d21 Reformat example; use "new()" in place of "resources" 2016-12-16 11:15:33 -08:00
joeduffy 284cec204d Experiment with intersection types
This change experiments with using intersection types to cut down
on some of the boilerplate -- and make reuse easier -- in the
service definitions.
2016-12-16 10:04:46 -08:00
joeduffy ed1eebe7e5 Clean up imports 2016-12-15 19:42:48 -08:00
joeduffy 2e941bbc57 Make an initial attempt at a better factoring
This splits the overall example rack service into many sub-services.
This leads to a much cleaner factoring of the code.  Note that there are
some missing properties -- it's hard to eyeball this without a real compiler.
But the essence of the example is pretty spot on.
2016-12-15 19:40:34 -08:00
joeduffy 68a3d27a73 Use "prop: value" instead of "prop = value"
I personally prefer this syntax.  It is more "declarative" and, particularly
because we support true assignments, I feel like it's more representative of
what's going on.  It's easier to scan for real imperative assignments.  This
approach also eliminates a single horizontal character per assignment.
2016-12-15 17:57:36 -08:00
joeduffy 14471c0ac7 Experiment with different syntax for resource creation
In this change, ":= new" declares a new resource.

In addition, we change arrays to be Go-like, in that zero-initialized
ones can be appended to safely, such that declaring a new instance is
done merely by stating "var arr: T[]".
2016-12-15 17:50:10 -08:00
joeduffy 47e1125f3b Use arrays to cut down on boilerplate
This is all hand-waving, of course, however it's helping with the language design.
2016-12-15 16:58:21 -08:00
joeduffy 5e652c3dd3 Check in the Xovnoc conversion example 2016-12-15 16:40:49 -08:00
joeduffy 5549d3a2e8 Make a few minor language doc edits 2016-12-15 16:40:19 -08:00
joeduffy d972ab9b6b Talk a little about runtime bindings 2016-12-14 16:55:24 -08:00
joeduffy 9d9c57335f Rename macro to func; rename mu/func to mu/lambda 2016-12-14 16:44:31 -08:00
joeduffy 540d058cf2 Use a separate service for AWS cluster
This change encapsulates what's required for an AWS cluster in new service,
mu/clouds/aws/Cluster, so that mu/Cluster can remain fairly simplistic (it
just switches on the names and dispatches to the appropriate sub-modules).
2016-12-14 15:15:29 -08:00
joeduffy 46e89084bf Add a hypothetical Echo example 2016-12-14 15:13:17 -08:00