問題描述
閱讀 Peter 關于 JavaScript 的文章后我注意到了
Brendan Eich 表示,Harmony 的目標之一是成為 JavaScript 編譯器的更好目標.
Brendan Eich stated that one the goals for Harmony is to be a better target for to-JavaScript compilers.
目前有兩個流行的編譯器具有一些模糊的ES:Harmony 合規性:
There are currently two popular compilers with some vague ES:Harmony compliance:
- Traceur
- CoffeeScript
盡管 CoffeeScript 有一些合規性,但它并不是為 ES:Harmony 編譯器而設計的,因此它對此沒有用處.
Although CoffeeScript has some compliance it's not designed to be an ES:Harmony compiler so it's not useful to this end.
Tracuer 似乎更嚴格地遵守 ES:Harmony 規范,但我不知道它是否打算成為一個完整的 ES:Harmony 編譯器.
Tracuer seems to be sticking more rigorously to the ES:Harmony specification but I don't know whether it intends to become a full ES:Harmony compiler.
由于目標是將 ES6 編譯為 ES3,因此還需要支持 ES5 功能(并且可能需要切換是將 ES5 編譯為 ES3 還是將 ES6 編譯為 ES3).
Since the aim is to to compile ES6 down to ES3 it would also need to support ES5 features (and probably a switch whether to compile ES5 to ES3 or ES6 to ES3).
- 目前是否還有其他項目旨在創建完整的 ES:Harmony to ES3 編譯器?
- 在知道標準是年輕/不穩定/不斷變化的情況下開始編寫這樣的編譯器是否明智.
- 目前是否有任何 ES5 -> ES3 編譯器?
我在 Traceur 郵件列表上留下了一個問題.
I've left a question on the Traceur mailing list.
這種編譯器的目標是向后兼容 ES3.沒有在 ES3 中完全模擬 ES5 和 ES6.
The aim of such a compiler would be backwards compatibility with ES3. Not full emulation of ES5 and ES6 in ES3.
推薦答案
Continuum 已經實現了大部分相關功能,應該在 es3 瀏覽器(如舊版 IE)中運行.
Continuum has implemented most of the relevant features and should run in es3 browsers (like older IEs).
這篇關于ECMAScript:Harmony/ES6 到 JavaScript 編譯器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!