3 ms·
Rather than a Javascript 'Alternative', out of interest what is the best way of using Current / Future Javascript? Looking at wikipedia (and I may be getting m
by CJefferson 14y ago
Rather than a Javascript 'Alternative', out of interest what is the best way of using Current / Future Javascript?
Looking at wikipedia (and I may be getting misinformed here) the most recent version of 'Javascript Extensions' is 1.8.1, and EMCA is on edition 5. However support for both of these seems patchy.
I often see mentions of all kinds of polyfills, but is there a nice library and/or compiler, which gives me access to the "Javascript of the future", on browsers which do not yet support it? Is this even a sensible thing to ask for?
- bebraw 14y agoHi, You might want to check out Esprima (http://esprima.org/ http://esprima.org/). You will find a couple of alternatives there. See http://code.google.com/p/traceur-compiler/ http://code.google.com/p/traceur-compiler/ as well.
- camus 14y agosome features cannot be "polyfilled". You cant magically make proxies , weakmaps ,let , or generators , or even modules(the python way) work just by adding a library to Javascript. You cant change inner workings of the language with functions. If you could there would be no point creating a future version of the language. All transpilers that compile down to javascript are basically syntaxic sugar generators , but do not add semantic like ES6 does.
- masklinn 14y agoTechnically you can absolutely implement most of them (the most problematic are probably weakmaps, as weakref require GC cooperation, and "true generators"), since you can implement all of them on e.g. C. However implementing them means a more complex compiler, more low-level resulting JS, and potentially a runtime within the JS runtime (essentially coding a VM in javascript, within which your language runs).
- quarterto 14y agoCheck out https://github.com/matthewrobb/six https://github.com/matthewrobb/six and https://github.com/jdiamond/harmonizr https://github.com/jdiamond/harmonizr.
- olavk 14y agoMascara (http://www.mascaraengine.com http://www.mascaraengine.com) supports a bunch of the proposed ECMAScript extensions, including classes, destructuring assignments, generators, getters/setters and array comprehensions.