excluding features from sloppy mode

Brendan Eich brendan at mozilla.com
Mon Dec 31 21:12:07 PST 2012


Mark S. Miller wrote:
>> Thanks for clarifying the primacy of "the rule". It was not clear, and it
>> >  does not match what Dave proposed that Mark reconfirmed as "1JS". Although
>> >  Dave left some wiggle room in his first post, I want to say that my attempts
>> >  to make all new body-forms strict don't fit under the consensus "1JS" name
>> >  and I'm not trying to usurp it. Your proposal should be called "2JS" since
>> >  to get the new stuff, you have to "use strict".
>
> In that case, I did not understand Dave's clarification. I thought
> Dave clarified this to mean only no new additional modes or opt-ins
> beyond those we already have, i.e., no mime types, additional pragmas,
> etc.

Yes, that much -- but more.

>   As I understood Dave's clarification, 1JS is orthogonal to our
> decisions about how many of the new features to make available in
> sloppy mode.

No, Dave explicitly proposed that module be available in sloppy mode:

https://mail.mozilla.org/pipermail/es-discuss/2011-December/019112.html

"We can do better, and the way we can do it is with modules. We can 
introduce module syntax in a backwards-compatible way, and use them as 
the implicit opt-in for any new semantics [2]."

>   Andreas' position (and Kevin's pre-compromise position)
> is then consistent with 1JS.

It may be that we can relax "1JS" to mean less than Dave proposed, but I 
don't agree if it means "use strict" must be written to use any new 
syntax. Not that I'm playing brinksmanship games, just saying. Dave 
proposed it, the "1JS" name was coined soon after, and module in sloppy 
mode was always part of it.

Kevin separated module back out in his pre-compromise position but did 
not try to use or abuse "1JS" for that position.

I'm pretty happy with Kevin's compromise. Here it is again:

(1) No opt-in required for new syntax, except:
(2) No breaking changes to sloppy mode, and
(3) No grammar contortions (e.g. let) to support sloppy mode.  And
(4) All new syntax forms with code bodies are implicit strict.

What do you say?

> Instead, what you say above seems to agree with what I thought 1JS
> meant when I posted my inflammatory message.

I don't know what you thought, but Dave always included module. You 
seemed to be reacting to 'let' contortions followed by function-in-block 
having two semantics, one de-facto and a browser-specific mess, the 
other block-scoped (hoisted binding and initialization of binding). The 
two are not the same!

If you stick with what Dave proposed, do you really object once again?

>   If this is what 1JS
> means, then, again, I do not subscribe to 1JS.

I don't know what "this" you mean. Can you be specific?

> If we cannot come to a common understanding of what 1JS means, we
> should find other terminology.

We have an archive, I keep posting links. True, not every message is 
unambiguous, correct, and otherwise complete. But "1JS" as 
module-in-sloppy-mode-opts-into-ES6(-and-into-strict) was the original 
post (plus some followup on the -and-into-strict bit).

Again I explicitly *do not* call my "new bodies are strict by fiat" / 
"new syntax is its own opt-in (where we can get away with it without 
breaking the web)" combo "1JS". I'd like it to be ES6, though :-P. 
Perhaps we should focus on the substantial points and not worry about 
the "1JS" brand just yet.

/be



More information about the es-discuss mailing list