Modules: compile time linking (was Re: Modules feedback, proposal)

John J Barton johnjbarton at
Thu Apr 5 20:23:53 PDT 2012

On Thu, Apr 5, 2012 at 10:01 AM, James Burke <jrburke at> wrote:

> So, assuming Math has no dependencies (just to make this shorter), the
> sequence of events:
> * Load Foo, convert to AST, find "from" usage.
> * Load Math
> * Compile Math
> * Evaluate Math
> * Inspect Math's exported module value for properties
> * Modify the compiled structure for Foo to convert "import *" to have
> local variables for all of Math's properties that are known, only at
> this time (no funny dynamic 'with' stuff)
> * Evaluate Foo

This is certainly the events I expect: is there an alternative? I suppose
the module syntax could support moving Evaluate Math to just before
Evaluate Foo. (a la a compiled language) The Math-level operations that
created Math properties would not be known to Foo. That would be a major
surprise to devs I think.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list