Commit graph

1307 commits

Author SHA1 Message Date
Luke Hoban 0b8d534caf Merge pull request #149 from lukehoban/master
More CLIDL -> LUMIDL updates
2017-05-18 18:40:03 -07:00
Luke Hoban 2a036c8693 More CLIDL -> LUMIDL updates 2017-05-18 17:21:08 -07:00
joeduffy ce1dc4e30b Fix an erroneous reference to lumi env deploy 2017-05-18 15:54:40 -07:00
joeduffy 558d35e9cd Add back a missing package ec2
This was mistakenly lopped off during the license conversation.
2017-05-18 15:54:07 -07:00
joeduffy 4108c51549 Reclassify Lumi under the Apache 2.0 license
This is part of pulumi/lumi#147.
2017-05-18 14:51:52 -07:00
Joe Duffy 59d56d3503 Merge pull request #148 from pulumi/lumi-rename
Rename Coconut to Lumi
2017-05-18 13:42:43 -07:00
joeduffy b7f3d447a1 Preserve the lumi prefix on our CLI tools
This change keeps the lumi prefix on our CLI tools.

As @lukehoban pointed out in person, as soon as we do pulumi/coconut#98,
most people (other than compiler authors themselves) won't actually be
typing the commands.  And, furthermore, the commands aren't all that bad.

Eventually I assume we'll want something like `lumi-js`, or
`lumi-js-compiler`, so that binaries are discovered dynamically in a way
that is extensible for future languages.  We can tackle this during #98.
2017-05-18 12:38:58 -07:00
joeduffy dafeb77dff Rename Coconut to Lumi
This is part of pulumi/coconut#147.

After it has landed, I will rename the repo on GitHub.
2017-05-18 11:38:28 -07:00
joeduffy ec27cfd22c Update object test to use new pointer constructor 2017-05-16 15:27:32 -07:00
joeduffy 8d6f4c0d69 Fix a minor error message typo 2017-05-15 17:50:13 -07:00
joeduffy 85b888d1fa Fix a misattributed diagnostics message 2017-05-15 17:49:30 -07:00
joeduffy 82e3624ea1 Implement property accessors
This change implements property accessors (getters and setters).

The approach is fairly basic, but is heavily inspired by the ECMAScript5
approach of attaching a getter/setter to any property slot (even if we don't
yet fully exploit this capability).  The evaluator then needs to track and
utilize the appropriate accessor functions when loading locations.

This change includes CocoJS support and makes a dent in pulumi/coconut#66.
2017-05-15 17:46:14 -07:00
joeduffy 4da37edf1c Remove stale submodules 2017-05-15 10:33:22 -07:00
joeduffy cac52ae572 Fix two minor comment issues 2017-05-15 06:30:17 -07:00
joeduffy 78dc0b4a47 Add some handy internal RTTI helpers (and some tests) 2017-05-13 21:17:49 -04:00
joeduffy 3849761065 Rewrite Mantle functions to use assets/archives 2017-05-13 20:13:58 -04:00
joeduffy e97632e668 Make the IDL compiler too 2017-05-13 20:11:20 -04:00
joeduffy 0325801e99 Run go test with -cover flag
This ensures that code coverage is emitted, something we need to start
paying closer attention to as we start hardening the system.
2017-05-13 20:07:49 -04:00
joeduffy eee0f3b717 Fix some golint warnings 2017-05-13 20:04:35 -04:00
joeduffy 09e786269a Correctly quote Makefile lint commands 2017-05-13 19:51:26 -04:00
joeduffy 71855c7c44 Split intrinsics
This change just refactors out the dynamic intrinsics functions, from the general
intrinsics file, in preparation for some new ones.
2017-05-13 19:22:52 -04:00
joeduffy ea7658f338 Guard against nil diffs 2017-05-08 14:52:17 -05:00
joeduffy d3c1d7057b Add some tests for stable property ordering 2017-05-06 16:22:06 -07:00
joeduffy 7d8aadeb1e Implement chronological stable object keys
We need a stable object key enumeration order and we might as well leverage
ECMAScript's definition for this.  As of ES6, key ordering is specified; see
https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys.

I haven't fully implemented the "numbers come first part" (we can do this as
soon as we have support for Object.keys()), but the chronological part works.
2017-05-06 16:09:49 -07:00
joeduffy 3e73a6b8ba Add an alloc.NewDynamic helper function 2017-05-06 15:39:39 -07:00
joeduffy fb3a6612f6 Fix a lambda lexical environment bug
This addresses a bug where we did not reconstruct the correct lexical
environment when restoring a lambda's captured context.  Namely, the local
variables scope "drifted" with respect to the evaluation scope slots.

This is an example program that triggered it:

    function mkeighty() {
        let eighty = 80;
        return () => eighty;
    }
    let group = new ec2.SecurityGroup(..., {
        ingress: [ ..., fromPort: mkeighty()(), ... ],
    });

I am going to work on turning this into a regression test with my next
checkin; there's a fair bit of test infrastructure "machinery" I need
to put in place, but the time has come to lay the foundation.
2017-05-04 16:38:46 -07:00
joeduffy 240cdb8f0f Implement lambdas in the runtime
This change completes implementing lambdas in the runtime, closing
out pulumi/coconut#62.  The change is mostly straightforward, with
most changes coming down to the fact that functions may now exist
that themselves aren't definitions (like class/module members).
The function stub machinery has also been updated to retain the
environment in which a lambda was created, effectively "capturing"
the lexically available variables.  Note that this is *not* dynamic
scoping, which will be a problem down the road when/if we want to
support Ruby.  My guess is we'll just have a completely different
DynamicallyScopedLambdaExpression opcode.
2017-05-04 14:03:51 -07:00
joeduffy 6822139406 Add a reference to x variable in test case 2017-05-04 11:04:28 -07:00
joeduffy 0de32db954 Add support for local functions
This change, part of pulumi/coconut#62, adds support for ECMAScript
local functions.  This leverages the recent support for lambdas.
The change also adds some new test cases for the various forms.

Here are some examples of supported forms:

    function outer() {
        // simple named inner function:
        function inner1() { .. };
        // anonymous inner function (just a lambda):
        let inner2 = function() { ... };
        // named and bound inner function:
        let inner3 = function inner4() { ... };
    }

These merely compile into lambdas that have been bound to local
variables with the appropriate names.
2017-05-04 10:57:26 -07:00
joeduffy fde88b7cf4 Permit Statements in SequenceExpressions
The previous shape of SequenceExpression only permitted expressions
in the sequence.  This is pretty common in most ILs, however, it usually
leads to complicated manual spilling in the event that a statement is needed.
This is often necessary when, for example, a compiler is deeply nested in some
expression production, and then realizes the code expansion requires a
statement (e.g., maybe a new local variable must be declared, etc).

Instead of requiring complicated code-gen, this change permits SequenceExpression
to contain an arbitrary mixture of expression/statement prelude nodes, terminating
with a single, final Expression which yields the actual expression value.  The
runtime bears the burden of implementing this which, frankly, is pretty trivial.
2017-05-04 10:54:07 -07:00
joeduffy 748432299a Implement lambdas in CocoJS
This change recognizes and emits lambdas correctly in CocoJS (as part
of pulumi/coconut#62).  The existing CocoIL representation for lambdas
worked just fine for functions, lambdas, and local functions.  There
still isn't runtime support, but that comes next.
2017-05-04 10:01:05 -07:00
joeduffy 1e67162331 Fix a couple silly mistakes 2017-05-04 09:53:52 -07:00
joeduffy 70e75063c2 Remove superfluous output from install.sh 2017-05-01 17:43:50 -07:00
joeduffy 7f634b4cf2 Remove pulumi/coconut#141 workaround 2017-05-01 17:13:30 -07:00
joeduffy 4e5140251b Implement support for computed property initializers
I've tripped over pulumi/coconut#141 a few times now, particularly with
the sort of dynamic payloads required when creating lambdas and API gateways.
This change implements support for computed property initializers.
2017-05-01 17:11:57 -07:00
joeduffy bcd44fc06f Update cross-cloud library to support the latest changes 2017-05-01 10:21:52 -07:00
joeduffy 08626715fd Revert change to managed policy ARN casing 2017-05-01 10:17:18 -07:00
joeduffy 5c156a43cf Permit missing symbols in more places 2017-05-01 10:11:20 -07:00
joeduffy 815aa26282 Improve a contract.fail error message 2017-05-01 09:46:59 -07:00
joeduffy 553462bbfd Lower level for transformSourceFile logging
This changes the CocoJS log-level for logging about transforming a file
so that it shows up in --verbose logging.
2017-05-01 09:45:09 -07:00
joeduffy c1696dc684 Regenerate Kubefission with latest CIDLC 2017-05-01 09:41:02 -07:00
joeduffy 6902d7e1b2 Update AWS Lambdas to take archives, not assets 2017-05-01 09:38:23 -07:00
joeduffy 335ea01275 Implement archives
Our initial implementation of assets was intentionally naive, because
they were limited to single-file assets.  However, it turns out that for
real scenarios (like lambdas), we want to support multi-file assets.

In this change, we introduce the concept of an Archive.  An archive is
what the term classically means: a collection of files, addressed as one.
For now, we support three kinds: tarfile archives (*.tar), gzip-compressed
tarfile archives (*.tgz, *.tar), and normal zipfile archives (*.zip).

There is a fair bit of library support for manipulating Archives as a
logical collection of Assets.  I've gone to great length to avoid making
copies, however, sometimes it is unavoidable (for example, when sizes
are required in order to emit offsets).  This is also complicated by the
fact that the AWS libraries often want seekable streams, if not actual
raw contiguous []byte slices.
2017-04-30 12:37:24 -07:00
joeduffy 06b6ce3e44 Add a GH CI/CD sample
This is the code we want to get working with pulumi/coconut#134.
My goal this week is to make that happen!
2017-04-30 09:05:02 -07:00
joeduffy 69df382da9 Update the CIDLC README with build, running, etc. instructions 2017-04-30 08:36:57 -07:00
joeduffy 35a86d9089 Move AWS instanceMaps module back to ec2 2017-04-29 16:01:13 -07:00
joeduffy 0e16aa5d93 Make resource names the first constructor parameter
This reverts back to the old style of having the resource name as its
first parameter in the generated package.  Stylistically, this reads a
little nicer, and also ensures we don't need to rewrite all our existing
samples/test cases, etc.
2017-04-29 15:58:34 -07:00
joeduffy fa24d436e3 Unpointerize some types
In a few places, an IDL type will be a pointer, but the resulting
RPC code would, ideally, be the naked type.  Namely, in both resource
and asset cases, they are required to be pointers in the IDL (because
they are by-pointer by nature), but the marshaled representations need
not be pointers.  This change depointerizes such types in the RPC
unless, of course, they are optional in which case pointers still make
sense.  This avoids some annoying dereferencing and is the kind of thing
we want to do sooner before seeing widespread use.
2017-04-29 15:38:56 -07:00
joeduffy fe93f5e76f Strongly type resource IDs in the IDL/RPC/Providers
This change simply uses the `resource.ID` type in all the places
where it belongs, rather than using `string`-typed resource IDs.
2017-04-29 13:27:39 -07:00
joeduffy d8627697df Unglide AWS provider
This triggers complicates with local development, due to the way
that Glide vendors dependencies.  After we move to distinct repos
for the various provider packages, we can go back to doing this.
2017-04-29 13:26:39 -07:00