ECMAScript:Harmony/ES6 到 JavaScript 编译器 [英] ECMAScript:Harmony / ES6 to JavaScript compiler

查看:22
本文介绍了ECMAScript:Harmony/ES6 到 JavaScript 编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读 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:

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

  1. 目前是否还有其他项目旨在创建完整的 ES:Harmony to ES3 编译器?
  2. 在知道标准是年轻/不稳定/不断变化的情况下开始编写这样的编译器是否明智.
  3. 目前是否有任何 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 编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆