Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).


To 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)


To expand: use strict is always in force in ES6.


In 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).


Oops. Left off that key word :) Yes, ES6 modules.


That's not correct: a small percentage of the JS community (maybe <1%) use TC39 modules (which enforce strict mode) vs just using npm.


I am correct because I'm talking about ECMAScript 6. 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.


In node perhaps.

They're extremely common in the front end world - all the fancy SPA frameworks and build systems promote & use them extensively.


That'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.


Google 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).


My understanding is that they use it for most of their front-end work but compile it to javascript. See angular-dart.


You 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.


Yeah, I said that's what it _was_ supposed to be ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: