4 ms·
I don't understand why doesn't an ECMAScript2 exist at this point, instead of just trying to patch JavaScript. The whole reason JScript and others ultimately f
by copperx 9y ago
I don't understand why doesn't an ECMAScript2 exist at this point, instead of just trying to patch JavaScript. The whole reason JScript and others ultimately failed were because they were not standardized. How hard is it for browser vendors to say "we'll implement ECMAScript2, whatever it is" so that we can all have a sane language to work with (while we wait for WebAssembly).
- dangoor 9y agoTo some extent there is, in that the javascript VMs can treat certain sorts of scopes (like Modules) differently because they know that those did not exist at an earlier time when certain bad behaviors were common. They debated quite a bit while working on ES6 about having a different script type to make more breaking changes, but they decided that this would be bad for evolution on the web (see the adoption of Python 3, for example)
- paulddraper 9y agoTo expand: use strict is always in force in ES6.
- gsnedders 9y agoIn ES6 modules, it is. In other code, ES6 is backwards compatible with ES5 (i.e., code is strict mode iff there's a "strict mode" declaration).
- paulddraper 9y agoOops. Left off that key word :) Yes, ES6 modules.
- nailer 9y agoThat's not correct: a small percentage of the JS community (maybe <1%) use TC39 modules (which enforce strict mode) vs just using npm.
- lexicality 9y agoIn node perhaps. They're extremely common in the front end world - all the fancy SPA frameworks and build systems promote & use them extensively.
- paulddraper 9y agoI am correct because I'm talking about ECMAScript 6. http://www.ecma-international.org/ecma-262/6.0/ http://www.ecma-international.org/ecma-262/6.0/ If you're talking about Node.js or JScript or something else, then that's different.
- Vinnl 9y agoThat's what Dart was supposed to be, in Google's eyes. The problem is both that it needs buy-in from all browser vendors (and the webdev community), and more importantly, that you'll now need to support both Javascript and the new language indefinitely. Especially considering that new mistakes will be made with the new language, and new quirks introduced, that doesn't sound that attractive.
- hajile 9y agoGoogle gave up on dart as an browser language quite a while ago. It now sees use server-side and in flutter (a native UI layer).
- Vinnl 9y agoYeah, I said that's what it _was_ supposed to be ;)
- tym0 9y agoMy understanding is that they use it for most of their front-end work but compile it to javascript. See angular-dart.
- hajile 9y agoYou are completely correct. I was considering that to be like ocaml, kotlin, scala, etc which transpile to JS. For what it's worth, I think either ocaml or SML is far better than dart for compiling to JS, but dart is far better than typescript (and has a more sound type system). It's not a huge wonder that Google apparently uses angular-dart instead of the typescript version.