pulumi/docs
joeduffy dc76cbb989 Add thoughts on a little language
This change includes a miniature spec for what we'd want out of a little
markup language that extends YAML/JSON with typing and minimal templating.

We've begun to reach the limits of what Go's templates give us; the usability
is quite poor: the order of template expansion is "confused" (as it must
happen before verification of stack properties); it is dumb textual copy-and-
paste, and thus knows nothing about the lexical and semantic rules; evaluation
of expressions that should produce actual objects inserted into the metadata
stream as-is must actually be serialized into text (problematic for the above
reasons); and, finally, as a result of all of this, failure modes are terrible.

But worse than this, we simply can't do what we need in many places.  For
instance, mapping a stack's properties onto the services that it creates works
in simple cases -- like strings, booleans, and ints -- but quickly breaks down
when referencing complex objects (for the same above reasons).  This is why
we've needed to special case property mapping in the aws/x/cf provider, but
clearly this won't generalize to all the compositional situations that arise.

It's worth nothing Hashicorp's HCL/HIL is closest to what we want.  (The
language used for Terraform.)  It isn't exactly what we want, however, for two
reasons.  First, it lacks conditionals and iteration.  This is likely to appear
at some point (see https://github.com/hashicorp/terraform/issues/1604), and
indeed in this past week alone, a new C-like conditional operator (which I
actually don't love) got added to HIL:
5fe4b10b43.
Second, and perhaps more importantly, its approach is to create a new language.
The design I list here is a natural extension that adds typechecking and
minimal templating to the existing YAML/JSON formats.  As a stand-alone
project, this whould have a much broader appeal.  And whether or not we use it
for Mu depends on whether we really want an entirely new markup language or not.

To cut to the chase, I'm shelving this for now.  I'm going to keep hacking my
way through the current Go templates plus special-casing for now.  My eye is
on the initial end-to-end prototype.  But, no doubt, we'll need to revisit this
immediately afterwards, make a decision, and make it happen.
2016-12-12 09:11:27 -08:00
..
architecture.md Clean up workspace file naming 2016-11-29 20:07:27 -08:00
deps.md Articulate how dependency versioning works 2016-11-22 13:22:29 -08:00
language.md Add thoughts on a little language 2016-12-12 09:11:27 -08:00
metadata.md Specify more about extensible schema types 2016-12-05 18:11:56 -08:00
security.md Add a note on AWS IAM mapping 2016-11-06 10:02:06 -08:00
targets.md Introduce intrinsic types 2016-12-05 13:46:18 -08:00
x-cloud.md Sketch out some cross-cloud abstraction thinking 2016-11-23 16:20:40 -08:00