ECMAScript
Կաղապար:Short description Կաղապար:Infobox programming language Կաղապար:Infobox file format
ECMAScript (/ˈɛkməskrɪpt/; ES)[1] ստանդարտ է սկրիպտային լեզուների համար, ներառյալ JavaScript, JScript և ActionScript: Այն առավել հայտնի է որպես JavaScript ստանդարտ, որը նախատեսված է տարբեր վեբ բրաուզերների միջև վեբ էջերի փոխգործունակությունն ապահովելու համար: Այն ստանդարտացված է Ecma International-ի կողմից ECMA-262 փաստաթղթում:
ECMAScript-ը սովորաբար օգտագործվում է Համաշխարհային ցանցում (WWW) հաճախորդի կողմից սկրիպտավորման համար, և այն ավելի ու ավելի է օգտագործվում սերվերի կողմի հավելվածների և ծառայությունների համար, որոնք օգտագործում են գործարկման ժամանակի միջավայրեր՝ Node.js[2] deno[3] և bun.[4] :
ECMAScript, ECMA-262, JavaScript
ECMA-262, or the ECMAScript Language Specification, defines the ECMAScript Language, or just ECMAScript.[5] ECMA-262 specifies only language syntax and the semantics of the core application programming interface (API), such as Array, Function, and globalThis, while valid implementations of JavaScript add their own functionality such as input/output and file system handling.
History
The ECMAScript specification is a standardized specification of a scripting language developed by Brendan Eich of Netscape; initially named Mocha, then LiveScript, and finally JavaScript.[6] In December 1995, Sun Microsystems and Netscape announced JavaScript in a press release.[7] In November 1996, Netscape announced a meeting of the Ecma International standards organization to advance the standardization of JavaScript.[8] The first edition of ECMA-262 was adopted by the Ecma General Assembly in June 1997. Several editions of the language standard have been published since then. The name "ECMAScript" was a compromise between the organizations involved in standardizing the language, especially Netscape and Microsoft, whose disputes dominated the early standards sessions. Eich commented that "ECMAScript was always an unwanted trade name that sounds like a skin disease."[9] ECMAScript has been formalized through operational semantics by work at Stanford University and the Department of Computing, Imperial College London for security analysis and standardization.[10] "ECMA" stood for "European Computer Manufacturers Association" until 1994.
Version history
Features
The ECMAScript language includes structured, dynamic, functional, and prototype-based features.[11]
Imperative and structured
ECMAScript JavaScript supports C-style structured programming. Previously, JavaScript only supported function scoping using the keyword var
, but ECMAScript 2015 added the keywords let
and const
, allowing JavaScript to support both block scoping and function scoping. JavaScript supports automatic semicolon insertion, meaning that semicolons that normally terminate a statement in C may be omitted in JavaScript.[12]
Like C-style languages, control flow is done with the
, while
, for
/ do
, while
/ if
, and else
statements. Functions are weakly typed and may accept and return any type. Arguments not provided default to switch
.
undefined
Weakly typed
ECMAScript is weakly typed. This means that certain types are assigned implicitly based on the operation being performed. However, there are several quirks in JavaScript's implementation of the conversion of a variable from one type to another. These quirks have been the subject of a talk entitled Wat.[13][14]
Dynamic
ECMAScript is dynamically typed. Thus, a type is associated with a value rather than an expression. ECMAScript supports various ways to test the type of objects, including duck typing.[15]
Transpiling
Since ES 2015, transpiling JavaScript has become very common. Transpilation is a source-to-source compilation in which newer versions of JavaScript are used, and a transpiler rewrites the source code so that it is supported by older browsers. Usually, transpilers transpile down to ES3 to maintain compatibility with all versions of browsers. The settings to transpile to a specific version can be configured according to need. Transpiling adds an extra step to the build process and is sometimes done to avoid needing polyfills. Polyfills create new features for older environments that lack them. Polyfills do this at runtime in the interpreter, such as the user's browser or on the server. Instead, transpiling rewrites the ECMA code itself during the build phase of development before it reaches the interpreter.
Conformance
In 2010, Ecma International started developing a standards test for Ecma 262 ECMAScript.[16] Test262 is an ECMAScript conformance test suite that can be used to check how closely a JavaScript implementation follows the ECMAScript Specification. The test suite contains thousands of individual tests, each of which tests some specific requirement(s) of the ECMAScript specification. The development of Test262 is a project of the Ecma Technical Committee 39 (TC39). The testing framework and the individual tests are contributed to Ecma by member organizations of TC39.
Important contributions were made by Google (Sputnik test suite) and Microsoft, who both contributed thousands of tests. The Test262 test suite consisted of 014 tests as of Հունվարի 2020 38[update].[17] ECMAScript specifications through ES7 are well-supported in major web browsers. The table below shows the conformance rate for current versions of software with respect to the most recent editions of ECMAScript.
Scripting engine | Reference application(s) | Conformance[18] | |||
---|---|---|---|---|---|
ES5[19] | ES6 (2015)[20] | ES2016+[21] | Next[22][23] | ||
SpiderMonkey | Firefox 120 | 100% | 98% | 98% | 5% |
V8 | Google Chrome 117, Microsoft Edge 113, Opera 98 | 100% | 98% | 98% | 5% |
JavaScriptCore | Safari 17 | 99% | 100% | 98% | 11% |
See also
References
- ↑ Stefanov, Stoyan (2010). JavaScript Patterns. O'Reilly Media, Inc. էջ 5. ISBN 9781449396947. Արխիվացված օրիգինալից 2016-06-10-ին. Վերցված է 2016-01-12-ին. «The core JavaScript programming language [...] is based on the ECMAScript standard, or ES for short.»
- ↑ «Node.js — ECMAScript 2015 (ES6) and beyond».
- ↑ «Deno joins JavaScript standards effort». 14 December 2021.
- ↑ https://bun.sh/docs#:~:text=or%2C%20more%20formally%2C-,ECMAScript,-)%20is%20just%20a bun
- ↑ Guo, Shu-yu (2022-02-14). «ECMAScriptÂŽ 2022 Language Specification». tc39.es. Արխիվացված օրիգինալից 2020-05-08-ին. Վերցված է 2022-02-14-ին.
- ↑ Krill, Paul (2008-06-23). «JavaScript creator ponders past, future». infoworld.com. InfoWorld. Արխիվացված օրիգինալից 2014-09-20-ին. Վերցված է 2013-10-31-ին.
- ↑ «Netscape and Sun announce JavaScript, the Open, Cross-platform Object Scripting Language for Enterprise Networks and the Internet». Netscape.com. Netscape. 1995-12-04. Արխիվացված է օրիգինալից 2002-06-06-ին. Վերցված է 2019-11-04-ին.
- ↑ Press Release (November 15, 1996). «Industry Leaders to Advance Standardization of Netscape's JavaScript at Standards Body Meeting». Netscape.com. Netscape. Արխիվացված է օրիգինալից 1998-12-03-ին. Վերցված է 2013-10-31-ին.
- ↑ Eich, Brendan (2006-10-03). «Will there be a suggested file suffix for es4?». mozilla.org. Mail.mozilla.org. Արխիվացված օրիգինալից 2020-06-21-ին. Վերցված է 2021-05-05-ին.
- ↑ Maffeis, Sergio; Mitchell, John C.; Taly, Ankur (2020-01-03). «An Operational Semantics for JavaScript» (PDF). stanford.edu. Association for Computing Machinery. Արխիվացված (PDF) օրիգինալից 2020-01-03-ին. Վերցված է 2020-01-03-ին.
- ↑ «About». ECMAScript. Արխիվացված է օրիգինալից 2012-08-02-ին. Վերցված է 2009-12-17-ին.
- ↑ David Flanagan (17 August 2006). JavaScript: The Definitive Guide: The Definitive Guide. "O'Reilly Media, Inc.". էջ 16. ISBN 978-0-596-55447-7. Արխիվացված օրիգինալից 1 August 2020-ին. Վերցված է 11 November 2019-ին.
- ↑ Bernhardt, Gary. Wat. CodeMash 2012. Destroy All Software. Արխիվացված օրիգինալից 2019-10-28-ին. Վերցված է 2021-08-18-ին.
- ↑ Gilbertson, Scott (26 January 2012). «Jokes for Nerds: Wat Moments in Programming». Wired. Արխիվացված օրիգինալից 23 August 2020-ին. Վերցված է 22 August 2021-ին.
- ↑ «JavaScript data types and data structures – JavaScript | MDN». Developer.mozilla.org. 2017-02-16. Արխիվացված օրիգինալից 2017-03-14-ին. Վերցված է 2017-02-24-ին.
- ↑ «ECMAScript Language – test262». Test262.ecmascript.org. Արխիվացված է օրիգինալից 2011-05-14-ին. Վերցված է 2013-10-31-ին.
- ↑ «tc39/test262». GitHub. January 24, 2020. Արխիվացված օրիգինալից October 1, 2019-ին. Վերցված է January 29, 2020-ին.
- ↑ ES5 is the baseline for this test suite. The conformance rate for other editions reflects support for new features only, not a comprehensive score.
- ↑ «ECMAScript 5 compatibility table». compat-table.github.io (անգլերեն). 2024-04-14. Արխիվացված օրիգինալից 2024-01-14-ին. Վերցված է 2024-04-14-ին.
- ↑ «ECMAScript 6 compatibility table». compat-table.github.io (անգլերեն). 2024-04-14. Արխիվացված օրիգինալից 2024-04-04-ին. Վերցված է 2024-04-14-ին.
- ↑ «ECMAScript 2016+ compatibility table». compat-table.github.io (անգլերեն). 2024-04-14. Արխիվացված օրիգինալից 2024-01-14-ին. Վերցված է 2024-04-14-ին.
- ↑ «ECMAScript Next compatibility table». compat-table.github.io. 2024-04-14. Արխիվացված օրիգինալից 2024-01-14-ին. Վերցված է 2024-04-14-ին.
- ↑ Composite score that includes new features from ES7 through next edition drafts
Կաղապար:ECMAScript Կաղապար:Ecma International Standards Կաղապար:ISO standards Կաղապար:List of IEC standards