Comments on Meeting Notes

Brendan Eich brendan at mozilla.org
Tue Dec 4 10:48:14 PST 2012


Kevin Smith wrote:
> I recommend allowing let declarations only in strict mode.  This is 
> the simple, backwards-compatible path.  Strict mode only has a bad 
> reputation because, in ES5, it is restrictive-only.  There are 
> (almost) no carrots leading users there.

Strict mode has a bad rep for two other important causes:

* It forks runtime semantics, which requires careful testing in 
pre-ES5-strict implementations. This has been a real-world problem, 
multiple times.

* It deoptimizes, e.g. a strict-mode function must be optimized to copy 
actual parameter values into arguments if it could use the arguments object.

>  Leave non-strict as is, and let users opt-in to "let".  An excellent 
> carrot.

The problem is precisely that users cannot opt into "let" alone by its 
novel syntax. Opting into strict mode may or may not win but it has 
added costs and benefits, and that means let adoption will suffer.

1JS wants new syntax to be its own opt-in. The only issue with making 
let work in non-strict code is the obscure let[i] = j; pattern. If no 
one actually wrote such code (it's possible; public web searches by big 
search-engine companies, or at least one so far, found nothing), then we 
should not risk reduced let adoption by yoking it to the heavier burden 
of strict mode.

/be


More information about the es-discuss mailing list