ES6 doesn't need opt-in
brendan at mozilla.com
Mon Jan 9 07:54:03 PST 2012
On Jan 9, 2012, at 2:49 AM, Andreas Rossberg wrote:
> On 5 January 2012 20:10, Brendan Eich <brendan at mozilla.com> wrote:
>> On Jan 5, 2012, at 6:31 AM, Andreas Rossberg wrote:
>>> Sorry, I still think that a growing set of subtle implicit rules for
>>> activating subtle semantic changes
>> Not changes, new semantics for new syntax.
> I was referring to strict vs classic mode. The way I understood the
> discussion so far, certain syntax would implicitly opt into extended
> mode, and thereby also into strict mode -- locally, and from classic.
> That implies semantic changes for existing features.
The question is how bad these will be for anyone writing JS naively, based on current and emerging (ES6) docs, without explicit opt-in.
The answer entails at least:
1. ES5-strict semantic changes, e.g. arguments aliasing, without early errors.
2. Completion reform.
3. New early errors.
I think 3 is a good thing and a non-problem. Some of us hope 2 is a matter of indifference to real-world code, but we don't know for sure. That leaves 1.
No other semantic changes, right? The key idea of the state machine is not its exact spec (still being discussed) but that "one JS" should mean sane operation or early error, based on smooth upgrade to use non-conflicting new features (or conflicts, e.g. 'with' vs. 'module').
Why work harder on implicit opt-in? Yes, savvy users will put a pragma on line 1. Not all JS users are savvy and requiring them to become so asks too much.
> [The discussion seems to have changed direction again with Allen's
> "state machine" idea. That probably makes some of my comments
> obsolete. Sorry for lagging behind.]
More information about the es-discuss