May 21, 22, 23 TC39 Meeting Notes

Brendan Eich brendan at mozilla.com
Mon Jun 3 11:25:17 PDT 2013


Yehuda Katz wrote:
> On Mon, Jun 3, 2013 at 2:02 AM, Andreas Rossberg <rossberg at google.com 
> <mailto:rossberg at google.com>> wrote:
>
>     On 2 June 2013 22:19, Dmitry Soshnikov <dmitry.soshnikov at gmail.com
>     <mailto:dmitry.soshnikov at gmail.com>> wrote:
>     >> 4.10 Modules
>     >>
>     >> STH: Progress since last meeting. Discuss “module naming”,
>     “naming standard
>     >> modules”.
>     >> STH: http://wiki.ecmascript.org/doku.php?id=harmony:modules
>     >> STH: Wiki is up to date with the current proposal. Spec is
>     “wiki complete”.
>     >> Jason Orendorff of Mozilla has worked on flushing out semantic
>     issues. Moz
>     >> is implementinb parsing of modules.
>     >> STH: Syntax: Made a couple of changes.
>     >> A. To support anonymous exports
>     >>
>     >>   export default expr;
>     >>
>     >>   import $ from ‘jquery’;  // imports default anonymous export
>     >
>     > I missed that, and current wiki draft doesn't explain it either,
>     but -- what
>     > was a rationale of using string literals on imports, and, worth,
>     also for
>     > module names at define?
>
>     Modules won't have lexical scope, they will just be named by (more or
>     less) arbitrary strings in a single (per-loader) global name space.
>     That was a change made last November, and some of us (well, me, in
>     particular) have disagreed with it ever since. You can read up on most
>     of the pro & con arguments in the recent monster thread starting here:
>
>     https://mail.mozilla.org/pipermail/es-discuss/2013-April/030165.html
>
>     FWIW, I still think this is a fundamental mistake, but it is now
>     pretty much set in stone. Hopefully, we'll get proper lexical scoping
>     in ES7.
>
>
> I'm personally in favor of getting lexical scope in ES7, and 
> retrofitting the current module declarations so that they desugar into 
> the creation of a lexical module and a declarative registration of 
> that module in the registry.
>
> ```
> module "foo" {
>
> }
>
> // would be equivalent to something like
>
> module <gensym> {
>
> }
>
> export module <gensym> as "foo";
> ```
>
> We discussed this briefly at the last meeting on a whiteboard. It 
> requires some more thought, and I'd love to have you help work on 
> something like this for ES7.
>
> I'm glad that we came to a (grudging) consensus on moving forward with 
> the current ES6 proposal for ES6, with a clear idea on where to start 
> for ES7.

Me too. And for the record, I made a point (this was the second day, 
which was the last day of the three-day meeting that I could attend) as 
I was heading out: this "desugaring" or something like it shows that the 
ES6 syntax to declare-and-register at once, via

module "foo" {
   ...
}

is important to do first or at the same time, because any equivalent 
longer form is simply user-hostile in comparison.

I recall Andreas conceding this point, but I could have misinterpreted him.

If the concern is that the desugaring can't work, we can work through it 
in parallel with ES6 spec finalization and prototype implementations. 
But the short form is winning because short in the DRY sense. That's the 
whole point.

/be


More information about the es-discuss mailing list