4 ms·
I'm really asking myself when ECMA Script will take over the world. Everyone is talking about that it will be the NBL. It's not that I don't like ECMA Script bu
by oemera 16y ago
I'm really asking myself when ECMA Script will take over the world. Everyone is talking about that it will be the NBL. It's not that I don't like ECMA Script but there is a shit lot to do to implement all those language features into ECMA Script.
All those stuff and sure much more have to be done:
- performance of eval() (yes, I even don't know if this is ever possible)
- tools (great-eclipse-visual-studio-like IDE)
- Destructuring bind (e.g. x, y = returnTwoValues())
- Standard OOP with classes, instances, interfaces, polymorphism, etc.
- Visibility quantifiers (public/private/protected)
- Iterators and generators
- Namespaces and packages
- Operator overloading
- Static typing and duck typing
- Solid string and collection libraries
Does anyone know if ECMA Script is going to implement half of the stuff?
- grayrest 16y agoperformance of eval() This will probably not happen, the general consensus is that eval is basically considered harmful and you should use new Fuction(argname, argname, argname, code) to do the same thing. ES5 strict mode places a number of restrictions on what eval can do. tools (great-eclipse-visual-studio-like IDE) This is tricky and less necessary for non-C/Java/C# languages but I assume you mostly mean code completion and minor refactorings. The mozilla JS team has a type inferencer for JS, which is the first step, but it's not particularly useful. I've been poking at this, so we'll see if I come up with anything. Someone will get to this at some point even if I don't actually manage to make anything useful. For integrated debugging, I know the cloud9 IDE (web based) has been messing with node.js/Chrome debugger integration but I haven't messed with it. Destructuring bind (e.g. x, y = returnTwoValues()) http://wiki.ecmascript.org/doku.php?id=harmony:destructuring http://wiki.ecmascript.org/doku.php?id=harmony:destructuring Standard OOP with classes, instances, interfaces, polymorphism http://wiki.ecmascript.org/doku.php?id=strawman:classes http://wiki.ecmascript.org/doku.php?id=strawman:classes Visibility quantifiers access control via proxies: http://wiki.ecmascript.org/doku.php?id=harmony:proxies http://wiki.ecmascript.org/doku.php?id=harmony:proxies Iterators and generators Support available in Mozilla's implementation with the correct mime type. Brendan Eich wants to add them, but I can't find a harmony strawman for it (maybe it was accepted?). I do know yield is a reserved keyword in ES5 strict. Namespaces and packages Called modules: https://docs.google.com/Doc?id=dfgxb7gk_34gpk37z9v https://docs.google.com/Doc?id=dfgxb7gk_34gpk37z9v Operator overloading Not aware of anything. Static typing and duck typing Static typing is available in ActionScript3. Not aware of any efforts beyond this. I know there were proposals for type annotations in ES4 but I haven't heard much from ES5/Harmony in this area. I think most JS developers aren't particularly interested. Solid string and collection libraries Unlikely to be in the standard, look to implementations/userland libraries.
- randrews 16y agoAll that stuff would be nice to have, but I don't think they're required for it to be a widely useful language. What I think the minimal required set is: - Fix "this". Even people who know what they're doing screw it up. - Make keywords not reserved unless the language actually uses them. I mean seriously. - Namespaces / packages / something. - A package manager, like CPAN / Rubygems / whatever. - A good IDE (even a half-assed attempt at code completion) and a debugger. I happen to really like Dashcode, I think it would be good if it were more generic. Everything else on your list is great, but I think it can wait until later, or it's really just a feature of the language (not all languages have Smalltalk-style OO and That's Okay). Iterators and generators it actually has; operator overloading is widely reviled so I don't think that'll be a barrier to adoption.
- mjuhl24 16y agoOn keywords: "ES4 allows the use of keywords in contexts where they were prohibited in ES3, e.g., as field names in objects: {function:37}, o.try, and ns::catch are all legal." (http://www.ecmascript.org/es4/spec/overview.pdf http://www.ecmascript.org/es4/spec/overview.pdf, p35)
- njharman 16y agoif you accept ecma script ~= Javascript then it has already taken over. pretty much everything connected to web except embeded and even some of those runs javascript. with crossbrowser fixer libs and to lesser extent standards it is closer than anything else to write once run anywhere. more people have access to js dev tools than any other language. js is the new entry drug for new ddevs.