Commit graph

406 commits

Author SHA1 Message Date
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
joeduffy 646bb624db Rename rpcs to interface 2016-12-14 15:11:57 -08:00
joeduffy 8ba1bf6f22 Commit more progress on the metadata language design
Mostly a bunch of TODOs, however, a bit more about RPCs, services, streams,
and the output graph state.
2016-12-14 15:04:27 -08:00
joeduffy 87d2a6e06e Create a new design doc for the metadata language
This checkin includes a new design doc for the Mull metadata language.

This is very much a work-in-progress.

This will eventually supersede the language.md document.
2016-12-14 13:08:08 -08:00
joeduffy 4bc7737545 Eliminate quotes from module/import statements
There's no need for quotes here and having them makes it feel somehow
"dynamically typed" (I was subconsciously influenced by Go, I think).
Removing them...
2016-12-13 16:47:27 -08:00
joeduffy 468d7f8f3e A few renames
This change renames a few things; more to come, but this is at least
a self-consistent checkpoint:

* Use the "new" keyword to create service objects and not "resource".

* Use the "func" keyword to indicate functions and not "macro".

* Use "bool" instead of "boolean" for boolean types (more Go-like).
2016-12-13 16:39:37 -08:00
joeduffy e1c3494ba3 Fix two minor issues in the *.mu files
First, I meant to rename "func" to "macro".  This is perhaps contentious,
however my thinking was to differentiate between functions which have runtime
representations -- like lambdas, API gateway handlers, and the like -- and
macros which are purely a metadata/compile-time construct.

Second, there was a resource naming typo.
2016-12-13 15:44:12 -08:00
joeduffy 2d003a2df3 Sketching out a minimal configuration language
This sketches out a minimal configuration language, inspired by a combination
of the Mull document, Hashicorp's various language efforts, Protobufs, and a
mixture of TypeScript.  I'm attempting to whittle down the concepts to the bare
minimum necessary for a universal "intermediate language" for our runtime that
is (a) complete enough to serve our needs, (b) advanced enough to deliver some
of the improvements in componentization and reuse that we desire, (c) appealing
enough that humans are able to write code in the language while possibly even
enjoying it, and, yet, (d) sufficient for machine interoperability needs.

Of course, I will capture all of this in a proper specification (overwriting
the existing Mull one), however I wanted to land these as a proof of concept and
for feedback purposes.  Obviously, none of this code actually compiles or works!
2016-12-13 15:33:13 -08:00
joeduffy 1a3bfc182c Use strongly typed mu.Stacks, not strings, for CloudFormation's dependsOn 2016-12-12 18:56:37 -08:00
joeduffy 832bb80b47 Checkin an initial Mu container that targets AWS ECS
This is a work-in-progress.  In fact, it's going to radically change
given the new approach to representing resource construction, however
I wanted the snapshot in source control as we evolve things.
2016-12-12 17:56:54 -08:00
joeduffy e731229901 Make the Mu library a Node package; get it compiling
This change morphs the Mu library into a Node package and gets it
compiling against the latest AWS library and SDK changes.
2016-12-12 17:56:13 -08:00
joeduffy 47c67e7d5c Turn the AWS library into a Node package 2016-12-12 17:55:30 -08:00
joeduffy c7f0465c41 Make an aws/cloudformation module
This includes the original CloudFormation resource type in addition
to the various tag helpers.
2016-12-12 17:54:50 -08:00
joeduffy d10f2e6bff Get the AWS stacks compiling
This actually compiles... and does absolutely nothing (yet).
2016-12-12 17:25:27 -08:00