Modules: compile time linking (was Re: Modules feedback, proposal)
John J Barton
johnjbarton at johnjbarton.com
Fri Apr 6 11:48:38 PDT 2012
On Fri, Apr 6, 2012 at 10:59 AM, Brendan Eich <brendan at mozilla.org> wrote:
> John J Barton wrote:
>> The definite and small value of this check must be balanced against the
>> less clear but possibility larger value of flexibility granted by an
>> imperative export and JS's traditional compile/run cycle.
> There's no either-or here, so no need to balance. JS has lots of
> function&object-based expressiveness, almost all dynamic. Modules add
> checking and explicit control over staging that's latent in JS-in-HTML via
> multiple <script> tags. Want both.
With tags, developers control staging with declaration order, imperative
execution order, and event processing. These allow staging of JS and non-JS
resources as well as their computed outputs.
With modules, developers control staging by specifying dependencies.
Without support for non-JS dependencies and no control over execution
during the dependency traversal, the tag-based solution will be required
and mixing these two approaches needs to work well. Supporting non-JS
dependencies and allowing execution would open the possibility of loading
JS entirely with the module system. I think this goal is worth more than
the checking one.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss