3 ms·
Pragmatically, how does subsetting matter? ES6 transpilation will be a requirement for many more years. Once you transpile, all the ES6 requirements blow up (eg
by hajile 12y ago
Pragmatically, how does subsetting matter? ES6 transpilation will be a requirement for many more years. Once you transpile, all the ES6 requirements blow up (eg. not extending prototypes).
A more particular criticism. How does forcing let statements on everyone improve performance?
All it does is force implicit (rather than explicit) scoping rules on JS developers because devs from other languages don't seem to be able to understand functional scoping or hoisting. It's a huge case of X language isn't like Y language that I already know, so let's change the unfamiliar language.
- stupidcar 12y agoNot really. It's a way to enable increased performance by disallowing certain hard-to-optimise constructs.
- ryanisinallofus 12y agoWhich ones specifically?
- runeks 12y ago> [...] accessing missing properties throws, arrays cannot have holes, all scoping errors are static, classes are immutable.
- octatone2 12y agoI think it's important for the VM, which is what I got as to why they are proposing strong mode and sound types. I imagine that let and const afford optimizations to the VM.
- hajile 12y agoThe flag offers optimizations -- except they don't exist unless you compile a version of ES6 code for chrome only. Sure other ES6 browsers will ignore the string and move on, but they will have other ES6 compatibility issues. For example, Chrome's "fat arrow" doesn't do the lexical bind to the parent scope that the current spec requires. There are a ton of situations where this would break your code if you ran it on FF (and there are other differences). The only option is to transpile into ES5.1, but ES5.1 breaks the optimization requirements. Thus, using the optimization flag means building to Google's JS engine (we've been there with IE), while building a shared version means you cannot use the flag. Let adds scopes. Scopes are bad for performance (this is why closure compiler removes them). Removing them (if safe) is one more thing for the JIT to do. It's has little to do with efficiency and a lot to do with forcing another language's preferences on users.
- realityking 12y ago> For example, Chrome's "fat arrow" doesn't do the lexical bind to the parent scope that the current spec requires. And that's why fat arrows are currently not enabled in Chrome. Chrome exposes in development features behind flags. IMO vastly better than the vendor prefixes of ages past.