Module Execution Order

Mark S. Miller erights at google.com
Wed Apr 10 11:25:42 PDT 2013


If a module is lexically nested, IMO it would violate encapsulation if it
could be directly named from outside that scope -- just like anything else
that is lexically nested. But this goes to the core of the issues we've
postponed till ES7.


On Wed, Apr 10, 2013 at 11:18 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu>wrote:

> On Wed, Apr 10, 2013 at 12:13 PM, Kevin Smith <zenparsing at gmail.com>
> wrote:
> >
> >
> >
> > On Wed, Apr 10, 2013 at 11:39 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu
> >
> > wrote:
> >>
> >> On Wed, Apr 10, 2013 at 11:01 AM, Kevin Smith <zenparsing at gmail.com>
> >> wrote:
> >> >
> >> >>
> >> >> I'm not sure what prior critique you're referring to.
> >> >
> >> >
> >> > Quite a while ago, I pointed out that concatenation would be difficult
> >> > with
> >> > nested modules, but I was operating under the assumption of
> interleaved
> >> > execution:  https://gist.github.com/zenparsing/3892979
> >>
> >> I think this transformation demonstrates why I prefer our current
> >> approach more than nested modules.  See my fork at
> >> https://gist.github.com/samth/5355676
> >
> >
> > The correct translation using nested modules (with the proper topological
> > execution order semantics), would be more like this:
> > https://gist.github.com/zenparsing/5355927
> >
> >> I don't particularly want to have this discussion yet another time,
> >
> > I don't remember having this discussion on es-discuss.  Not that it's a
> > requirement or anything...
>
> The meeting minutes contain some rather comprehensive notes on
> variants of this discussion.
>
> See
> https://github.com/rwldrn/tc39-notes/blob/master/es6/2012-11/nov-28.md#modules-update
> for an example.
>
> >> but (a) lexical modules as in our original design did not serve all
> >> the required use cases
> >
> > Given that bundling is possible with nested modules, I'm not sure what
> other
> > use cases `module "name"` is serving.  I'll look back through the use
> case
> > presentation, though.
>
> The most important use case not served by lexical modules is defining
> a module with a single name that multiple external modules can
> reference it with.  That's the use case discussed in the above meeting
> notes.
>
> Sam
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130410/dbb0797b/attachment.html>


More information about the es-discuss mailing list