Introduction of ECMAScript 2017 Language Specification

原文

https://www.ecma-international.org/ecma-262/8.0/index.html

中英对照

This Ecma Standard defines the ECMAScript 2017 Language. It is the eighth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one of the world's most widely used general-purpose programming languages. It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.

这份ECMA标准定义了ECMAScript 2017语言。它是ECMAScript语言标准的第8个版本。自从1997年公布了第一版之后,ECMAScript已经成长成为了世界上使用最为广泛的通用编程语言之一。最为大众熟知的就是它作为浏览器的内嵌脚本语言,此外它也常常用用作服务端和嵌入式的程序中。

ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company's Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet Explorer 3.0.

ECMAScript基于了一些早期技术,最著名的就是Javascript(Netscape)和JScript(Microsoft)。这门语言由Brendan Eich在Netscape发明,并且首次出现在了2.0版的浏览器中。它还出现在Netscape所有后续的浏览器,以及Microsoft自IE 3.0起的全部浏览器。

The development of the ECMAScript Language Specification started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma General Assembly of June 1997.

ECMAScript语言规范的发展始于1996年11月。第一版本的ECMA标准被ECMA大会于1997年6月采纳。

That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.

1998年4月,ECMA标准通过快速程序提交到了ISO/IEC,并作为国际标准ISO/IEC 16262得到批准。1998年6月的ECMA大会通过了第二版的ECMA-262,以满足ISO/IEC 16262的要求。第一版和第二版有着本质的不同。

The third edition of the Standard introduced powerful regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation of future language growth. The third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999 and published as ISO/IEC 16262:2002 in June 2002.

第三版的规范引入了强大的正则表达式,更好的字符串处理,新的控制语句,try/catch异常处理,更严格的错误定义,数值的格式化输出,以及一些未来语言扩展的小改动。第三版ECMAScript在1999年12月被ECMA大会采纳,并在2002年6月公布为ISO/IEC 16262:2002

After publication of the third edition, ECMAScript achieved massive adoption in conjunction with the World Wide Web where it has become the programming language that is supported by essentially all web browsers. Significant work was done to develop a fourth edition of ECMAScript. However, that work was not completed and not published as the fourth edition of ECMAScript but some of it was incorporated into the development of the sixth edition.

在第三版发布之后,ECMAScript获得了来自WWW的广泛使用,成为了所有浏览器支持的编程语言。然而,作为第4版的ECMAScript还没有完成,其中的一些特性就合并合并到了第6版中了。

The fifth edition of ECMAScript (published as ECMA-262 5th edition) codified de facto interpretations of the language specification that have become common among browser implementations and added support for new features that had emerged since the publication of the third edition. Such features include accessor properties, reflective creation and inspection of objects, program control of property attributes, additional array manipulation functions, support for the JSON object encoding format, and a strict mode that provides enhanced error checking and program security. The fifth edition was adopted by the Ecma General Assembly of December 2009.

第5版的ECMAScript(ECMA-262)对语言规范的实质解释进行了编码,它已经成为了浏览器的通用实现,并增加了在第3版中就出现的新特性。包括访问器属性,反射创建,对象检测,程序控制属性,额外的数组操作功能,支持JSON对象编码格式,严格模式提供了错误检查和程序安全。第5版在2009年被ECMA大会采纳。

The fifth edition was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated minor corrections and is the same text as ISO/IEC 16262:2011. The 5.1 Edition was adopted by the Ecma General Assembly of June 2011.

第5版通过快速程序提交到ISO/IEC JTC,被采纳为国际标准ISO/IEC 16262:2011。5.1版本的ECMAScript标准增加了一些错误修订,其他与ISO/IEC 16262:2001相同。 5.1版本被ECMA大会在2011年6月通过。

Focused development of the sixth edition started in 2009, as the fifth edition was being prepared for publication. However, this was preceded by significant experimentation and language enhancement design efforts dating to the publication of the third edition in 1999. In a very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. The goals for this addition included providing better support for large applications, library creation, and for use of ECMAScript as a compilation target for other languages. Some of its major enhancements included modules, class declarations, lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail calls. The ECMAScript library of built-ins was expanded to support additional data abstractions including maps, sets, and arrays of binary numeric values as well as additional support for Unicode supplemental characters in strings and regular expressions. The built-ins were also made extensible via subclassing. The sixth edition provides the foundation for regular, incremental language and library enhancements. The sixth edition was adopted by the General Assembly of June 2015.

2009年开始聚焦在第6版的开发,同时第5版已经准备公布。较之1999年发布的第3版,新版本增加了许多实验性的新功能和语言效率强化。非常真实的感受,第6版的完成花费了5年的努力。新版本包括了更好的支持大程序、库创建,以及使用ECMAScript作为其他语言的编译目标语言(译者注:比如typescript)。一些主要的新特征包括模块、类声明,块级作用域,迭代器和生成器,异步promise,解构模式,和尾调用优化。ECMAScript内建库扩展支持了额外的数据结构抽象,包括map,set,二进制array(译者注:arraybuff),额外的Unicode字符集和正则表达式。内建库同样可以通过继承扩展。第6版提供了基础的正则,增量语言和库的优化。第6版在2016年6月被ECMA大会采纳。

ECMAScript 2016 was the first ECMAScript edition released under Ecma TC39's new yearly release cadence and open development process. A plain-text source document was built from the ECMAScript 2015 source document to serve as the base for further development entirely on GitHub. Over the year of this standard's development, hundreds of pull requests and issues were filed representing thousands of bug fixes, editorial fixes and other improvements. Additionally, numerous software tools were developed to aid in this effort including Ecmarkup, Ecmarkdown, and Grammarkdown. ES2016 also included support for a new exponentiation operator and adds a new method to Array.prototype called includes.

ECMA 2016作为第一个在ECMA TC39新年规划中公布的ECMAScript版本,并开始了开发流程。从ECMAScript 2015源文档中构建了一个纯文本源文档,以作为完全基于GitHub的进一步开发的基础。在标准开发的过程中,数以百计的PR和问题被记录,代表着成千上万的问题修复,文档改进和其他提升。并且,大量的软件工具被开发出来增加像驴,包括ECMarkup,ECMarkdown和Grammarkdown。ES2016同样包含了新的取幂运算(译者注:即**运算),为Array.prototype增加了新的方法"includes"。

This specification introduces Async Functions, Shared Memory, and Atomics along with smaller language and library enhancements, bug fixes, and editorial updates. Async functions improve the asynchronous programming experience by providing syntax for promise-returning functions. Shared Memory and Atomics introduce a new memory model that allows multi-agent programs to communicate using atomic operations that ensure a well-defined execution order even on parallel CPUs. This specification also includes new static methods on Object: Object.values, Object.entries, and Object.getOwnPropertyDescriptors.

这份规范介绍了异步函数,共享内存,更小的语言原子操作,库提升,问题修复和排版更新。通过提供promise return函数,异步函数提升了异步编程的体验。共享内存和原子操作引入了新的内存模型,允许多个终端程序使用原子操作通信,这保证了并行CPU计算的执行顺序。这份规范同样包括了Object上的静态方法:Object.values,Object.entries,和Object.getOwnPropertyDescriptors。

Dozens of individuals representing many organizations have made very significant contributions within Ecma TC39 to the development of this edition and to the prior editions. In addition, a vibrant community has emerged supporting TC39's ECMAScript efforts. This community has reviewed numerous drafts, filed thousands of bug reports, performed implementation experiments, contributed test suites, and educated the world-wide developer community about ECMAScript. Unfortunately, it is impossible to identify and acknowledge every person and organization who has contributed to this effort.

很多个人及其背后代表的组织在ECMA TC39中做出了卓越的贡献以开发这个版本,包括前一个版本。此外,活跃的社区出面并提供了支持。社区复审了大量的草案,记录了数以千计的bug报告,完成实验性功能,提供测试用例,并在世界范围的开发者社区推广ECMAScript。不幸的事,无法一一将他们指出并感谢表达每一个个人和组织做出的贡献。

Show Comments

Get the latest posts delivered right to your inbox.