4 ms·
How is this different than the already well established Traceur compiler? https://github.com/google/traceur-compiler https://github.com/google/traceur-compiler
by Conlectus 12y ago
How is this different than the already well established Traceur compiler? https://github.com/google/traceur-compiler https://github.com/google/traceur-compiler
- Touche 12y agoTraceur is more complete. ESNext requires less overhead. For most Traceur features, if you want to run it in a browser, requires a rather large runtime. ESNext is more modular. You can use just some features which may or may not require a runtime. It just depends. Overall Traceur is "better". But ESNext is nice if you just want feature X and don't want the overhead of having to support everything.
- avidal 12y agoThat's what I want to know. There are dozens of es6 transpilers.
- tekacs 12y agoYup and the place to look for comparison of them is: http://kangax.github.io/compat-table/es6/ http://kangax.github.io/compat-table/es6/ Though admittedly facts like whether they support source maps (such as Traceur) or preserve comments (not Traceur) are omitted. EJS is impressive though.
- Flenser 12y agoHad to look at the compat-table source to find out that EJS is short for Echo JS https://github.com/toshok/echo-js https://github.com/toshok/echo-js (It's definately this repo: https://github.com/kangax/compat-table/pull/115 https://github.com/kangax/compat-table/pull/115 )
- johnbender 12y agoIIRC, Traceur compiles to es5 which is not supported in IE 8. [edit] It's not clear to me that this project compiles to es3, but that was my assumption when reading "JavaScript that will work today".
- v413 12y agoLooking at the compiled source, it looks like ES5 and not ES3. They use "use strict" and Object.defineProperties which are ES5 features. P.S. IE9 doesn't support ES5 strict mode so "use strict" might introduce some subtle bugs for that case.
- skrebbel 12y agoCould you explain how? I thought "use strict" only added more runtime checking, but does not change the semantics. Wouldn't IE9 just interpret the line as a bogus expression and move on?
- Zardoz84 12y agoI use "use strict" on JavaScript that runs over IE8/9 and I don't get errors from it.
- girvo 12y agoThat's because "use strict" is ignored in IE8/9 (thankfully). You usually won't run into any issues, but if you're relying on strict-mode for certain semantics you can run into some very subtle bugs. The chances of that are super low though, I've only ever done it on purpose :)
- heydenberk 12y agoOne reason: Traceur strips comments from the source, with no option to preserve them. You can't use Traceur to generate an intermediate build product that you then run through another compiler (eg. Closure Compiler) that uses comments for source annotation.