Lexical Modules Can't Wait

Andreas Rossberg rossberg at google.com
Mon Apr 15 09:21:29 PDT 2013

On 15 April 2013 17:13, Mark S. Miller <erights at google.com> wrote:
> On Mon, Apr 15, 2013 at 6:41 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>> I think we can all agree that, in principle, program structures which have
>> scope and define a namespace should be lexically identified and should nest,
>> unless there is some compelling reason otherwise.
>> A module, for any sane definition of the term in the context of
>> Javascript, has a scope and defines a namespace.  Therefore, unless we can
>> provide some overwhelming argument to the contrary, established design
>> principles tell us that modules should be lexically identified and should
>> nest.
>> It has been suggested that we can postpone adding lexical modules until
>> ES7.  But to do so would be to postpone conceptual integrity, which is not
>> an available option.
> Hi Kevin, if nothing in the ES6 module system precludes lexical modules, why
> is postponing lexical modules and conceptual integrity till ES7 not an
> option? In the same sense, we likewise postponed most of what is needed for
> classes to have conceptual integrity (as well as literal integrity ;)) till
> ES7. And the lexical scope cleanups in ES5/strict, in the same sense, didn't
> have conceptual integrity until the const/let/modules of ES6. We can't get
> agreement on everything at once. Sometimes, we need experience with the
> things we do get agreement on to inform the discussions about the remainder.

It's not as simple, though. If the alternative that currently is on
the table has serious issues, then putting it into the language --
especially as the only mechanism -- will set a precedence for what
many programmers henceforth consider idiomatic. We know how difficult
(or rather, impossible) it is to deal with such bad legacy once it has


More information about the es-discuss mailing list