All Topics  
ECMAScript

 

   Email Print
   Bookmark   Link






 

ECMAScript



 
 
ECMAScript is a scripting language
Scripting language

A scripting language, script language or extension language, is a programming language that allows some control of a single or many Application software....
, standardized by Ecma International
Ecma International

'Ecma International' is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's international reach....
 in the ECMA-262 specification
Specification (technical standard)

A specification is an explicit set of requirements to be satisfied by a material, product, or service. ...
. The language is widely used on the web
World Wide Web

The World Wide Web is a very large set of interlinked hypertext documents accessed via the Internet. With a Web browser, one can view Web pages that may contain writing, s, videos, and other multimedia and navigate between them using hyperlinks....
, and is often confused with JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 or JScript
JScript

JScript is the Microsoft dialect of the ECMAScript scripting language specification.JavaScript , JScript, and ECMAScript are very similar languages....
, the two major dialects
Programming language dialect

A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature. With languages such as Scheme and Forth , standards may be considered insufficient, inadequate or even illegitimate by implementors, so often they will deviate from the standard, making a new dialect....
 from which ECMAScript was standardized.

lass="link1" onMouseover='showByLink("m861619",this)' onMouseout='hide("m861619")'href="http://www.absoluteastronomy.com/topics/JavaScript">JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 was originally developed by Brendan Eich
Brendan Eich

Brendan Eich is a computer programmer and creator of the JavaScript programming language. He is the Chief Technology Officer at the Mozilla Corporation....
 of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript. In December 1995, Sun Microsystems
Sun Microsystems

Sun Microsystems, Inc. is a multinational corporation vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982....
 and Netscape announced JavaScript in a press release.






Discussion
Ask a question about 'ECMAScript'
Start a new discussion about 'ECMAScript'
Answer questions from other users
Full Discussion Forum



Encyclopedia


ECMAScript is a scripting language
Scripting language

A scripting language, script language or extension language, is a programming language that allows some control of a single or many Application software....
, standardized by Ecma International
Ecma International

'Ecma International' is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's international reach....
 in the ECMA-262 specification
Specification (technical standard)

A specification is an explicit set of requirements to be satisfied by a material, product, or service. ...
. The language is widely used on the web
World Wide Web

The World Wide Web is a very large set of interlinked hypertext documents accessed via the Internet. With a Web browser, one can view Web pages that may contain writing, s, videos, and other multimedia and navigate between them using hyperlinks....
, and is often confused with JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 or JScript
JScript

JScript is the Microsoft dialect of the ECMAScript scripting language specification.JavaScript , JScript, and ECMAScript are very similar languages....
, the two major dialects
Programming language dialect

A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature. With languages such as Scheme and Forth , standards may be considered insufficient, inadequate or even illegitimate by implementors, so often they will deviate from the standard, making a new dialect....
 from which ECMAScript was standardized.

History

JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 was originally developed by Brendan Eich
Brendan Eich

Brendan Eich is a computer programmer and creator of the JavaScript programming language. He is the Chief Technology Officer at the Mozilla Corporation....
 of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript. In December 1995, Sun Microsystems
Sun Microsystems

Sun Microsystems, Inc. is a multinational corporation vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982....
 and Netscape announced JavaScript in a press release. In March 1996 Netscape Navigator
Netscape Navigator

Netscape Navigator and Netscape are the names for the proprietary software web browser popular in the 1990s, and the flagship product of the Netscape Communications Corporation, and the dominant web browser in terms of Usage share of web browsers....
 2.0 was out, featuring support for JavaScript.

Due to the wide-spread success of JavaScript as a client-side scripting language for web pages, Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
 developed a compatible dialect of the language, naming it JScript
JScript

JScript is the Microsoft dialect of the ECMAScript scripting language specification.JavaScript , JScript, and ECMAScript are very similar languages....
 to avoid trademark issues. JScript added new date methods to fix the non-Y2K
Year 2000 problem

The Year 2000 problem was a notable computer bug resulting from the practice in early computer program design of representing the year with two digits....
-friendly methods in JavaScript, which were based on . JScript was included in Internet Explorer
Internet Explorer

Windows Internet Explorer , commonly abbreviated to IE, is a series of graphical user interface web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995....
 3.0, released in August 1996.

Netscape submitted JavaScript to Ecma International
Ecma International

'Ecma International' is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's international reach....
 for standardization; the work on the specification, ECMA-262, began in November 1996. The first edition of ECMA-262 was adopted by the ECMA General Assembly of June 1997.

ECMAScript is the name of the scripting language standardized in ECMA-262. Both JavaScript and JScript aim to be compatible with ECMAScript, while providing additional features not described in the ECMA specification.

The name "ECMAScript" was a compromise between the organizations involved in standardizing the language, especially Netscape and Microsoft. Brendan Eich, the creator of JavaScript, is on record as saying that "ECMAScript was always an unwanted trade name that sounds like a skin disease."

Versions

There are three editions of ECMA-262 published. Work on a revision to the third edition known as "ECMAScript 3.1", and on a future edition codenamed "Harmony", is in progress.

EditionDate publishedDifferences to the previous editionEditor
1June 1997First editionGuy L. Steele, Jr.
Guy L. Steele, Jr.

Guy Lewis Steele Jr., , also known as "The Great Quux" and GLS , is an American computer scientist who has played an important role in designing and documenting several computer programming languages....
2June 1998Editorial changes to keep the specification fully aligned with ISO/IEC 16262 international standardMike Cowlishaw
Mike Cowlishaw

Mike Cowlishaw is an IBM Fellow based at IBM UK?s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and a Fellow of the Royal Academy of Engineering , the Institute of Engineering and Technology , and the British Computer Society....
3December 1999Added regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and other enhancementsMike Cowlishaw
Mike Cowlishaw

Mike Cowlishaw is an IBM Fellow based at IBM UK?s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and a Fellow of the Royal Academy of Engineering , the Institute of Engineering and Technology , and the British Computer Society....
3.1Work in progressAdds "strict mode", a subset intended to provide more thorough error checking and avoid error-prone constructs. Clarifies many ambiguities in the 3rd edition specification, and accomodates behaviour of real-world implementations that differed consistently from that specification. Adds some new features, such as getters and setters, library support for JSON
JSON

JSON , short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays ....
, and more complete reflection
Reflection (computer science)

In computer science, reflection is the process by which a computer program can observe and modify its own structure and behaviour. The programming paradigm driven by reflection is called reflective programming....
 on object properties.
 
HarmonyWork in progressMultiple new concepts and language features — see the section "Future development" below. 


In June 2004 Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as E4X
E4X

ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to Document Object Model interfaces that uses a simpler syntax for accessing XML documents....
 (ECMAScript for XML).

ECMA also defined a "Compact Profile" for ECMAScript — known as ES-CP, or ECMA 327 — which is designed for resource-constrained devices. Several of the dynamic features of ECMAScript (such as the "eval" function) are made optional, thus allowing the runtime to make more assumptions about the behaviour of programs and therefore make more performance trade-offs when running the code. The HD DVD
HD DVD

HD DVD is a discontinued high-density optical media optical disc format for storing data and high-definition video.HD DVD was supported principally by Toshiba, and was envisaged to be the successor to the standard DVD format....
 standard is one place where the ECMAScript Compact Profile is used in favour of full ECMAScript in order to reduce processing and memory requirements on a device.

Features

The ECMAScript language includes structured
Structured programming

Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement ....
, dynamic
Dynamic programming language

Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compiler, if at all....
, functional
Functional programming

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of function s and avoids program state and immutable object data....
, and prototype-based
Prototype-based programming

Prototype-based programming is a style of object-oriented programming in which class es are not present, and behavior reuse is performed via a process of cloning existing object s that serve as prototypes....
 features.

Syntax


Dialects

ECMAScript is supported in many applications, especially web browser
Web browser

A Web browser is a application software which enables a user to display and interact with text, images, videos, music, games and other information typically located on a Web page at a website on the World Wide Web or a local area network....
s, where it is commonly called JavaScript. Dialects sometimes include extensions to the language, or to the standard library
Standard library

A standard library for a programming language is the library that is conventionally made available in every implementation of that language. In some cases, the library is described directly in the programming language specification; in other cases, the contents of the standard library are determined by more informal social practices in the...
 and related API
Application programming interface

An application programming interface is a set of subroutine, data structures, class and/or Protocol provided by library and/or operating system Service s in order to support the building of applications....
s such as the W3C
World Wide Web Consortium

The World Wide Web Consortium is the main international standards organization for the World Wide Web . It is arranged as a consortium where member organizations maintain full-time staff for the purpose of working together in the development of standards for the World Wide Web....
-specified DOM
Document Object Model

The Document Object Model is a platform- and programming language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface for querying, traversing and manipulating such documents....
. This means that applications written in one dialect may be incompatible with another, unless they are written to use only a common subset of supported features and APIs.

Note that there is a distinction between a dialect and an implementation. A dialect of a language is significant variation of the language, while an implementation of a language/dialect executes a program written in that dialect.

ApplicationDialect and latest versionECMAScript edition
Google Chrome
Google Chrome

Google Chrome is a web browser developed by Google and based on the WebKit layout engine and application framework.In February 2009, it had a share of 1.15% of the web browser market....
, the V8
V8 (JavaScript engine)

The V8 JavaScript engine is an open source JavaScript engine developed by Google in Denmark and shipping with the Google Chrome browser.It increases performance by compiling JavaScript to native machine code before running it, rather than to a bytecode or Interpreter it and by employing optimization techniques like Inline caching....
 engine
JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
ECMA-262, edition 3 9
Mozilla Firefox
Mozilla Firefox

Mozilla Firefox is a web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. Official versions are distributed under the terms of the proprietary EULA....
, the Gecko
Gecko (layout engine)

Gecko is a layout engine currently developed by Mozilla Corporation, known as the layout engine of the Mozilla Firefox web browser, Mozilla Application Suite, Nvu, Mozilla Thunderbird and many more....
 layout engine, SpiderMonkey, and Rhino
Rhino (JavaScript engine)

Rhino is an open source JavaScript engine. It is developed entirely in Java and managed by the Mozilla Foundation. The Foundation also provides an implementation of JavaScript in C known as SpiderMonkey ....
 6
JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.8
ECMA-262, edition 3
Internet Explorer
Internet Explorer

Windows Internet Explorer , commonly abbreviated to IE, is a series of graphical user interface web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995....
, the Trident
Trident (layout engine)

Trident is the name of the layout engine for the Microsoft Windows version of Internet Explorer. It was first introduced with the release of Internet Explorer 4 in October 1997; it has been steadily upgraded and remains in use today....
 layout engine
JScript
JScript

JScript is the Microsoft dialect of the ECMAScript scripting language specification.JavaScript , JScript, and ECMAScript are very similar languages....
 5.7
ECMA-262, edition 3
Opera
Opera (web browser)

Opera is a web browser and Internet suite developed by the Opera Software company. Opera handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent , and reading web feeds....
ECMAScript with some JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.5
and JScript
JScript

JScript is the Microsoft dialect of the ECMAScript scripting language specification.JavaScript , JScript, and ECMAScript are very similar languages....
 extensions
ECMA-262, edition 3
KHTML
KHTML

KHTML is the HTML layout engine developed by the KDE project. It is the engine used by the Konqueror web browser. A fork ed version of KHTML called WebKit is used by several web browsers, among them Safari and Google Chrome....
 layout engine, KDE's Konqueror
Konqueror

Konqueror is a web browser, file manager and file viewer designed as a core part of the KDE. It is developed by volunteers and can run on most Unix-like operating systems....
, and Apple's Safari
Safari (web browser)

Safari is a web browser developed by Apple Inc.. First released as a beta on January 7, 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3, commonly known as "OS X Panther." Apple has also made Safari the native browser for the iPhone OS....
7
JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.5 1
ECMA-262, edition 3 5
, Samba 4
Samba (software)

Samba is a free software re-implementation of Server Message Block Computer networking protocol , originally developed by Australian Andrew Tridgell....
0.9.5ECMA-262, edition 3 8
Microsoft .NET Framework
.NET Framework

The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework....
JScript .NET
JScript .NET

JScript .NET is a .NET Framework programming language developed by Microsoft as a natural successor to Microsoft's Active Scripting language JScript....
 8.0
ECMA-262, edition 3 2
Adobe Flash
Adobe Flash

Adobe Flash is a multimedia Platform created by Macromedia and currently developed and distributed by Adobe Systems. Since its introduction in 1996, Flash has become a popular method for adding animation and interactivity to web pages; Flash is commonly used to create animation, advertisements, and various web page components, to integrate...
 and Adobe Flex
Adobe Flex

Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the proprietary Adobe Flash platform....
ActionScript
ActionScript

ActionScript is a scripting language based on ECMAScript. ActionScript is used primarily for the development of websites and software using the Adobe Flash Player platform , but is also used in some database applications , and in basic robotics, as with the Make Controller Kit....
 3
ECMA-262, edition 3 3
Adobe Acrobat
Adobe Acrobat

Adobe Acrobat is a family of software developed by Adobe Systems, designed to view, create, manipulate and manage files in Adobe's Portable Document Format ....
JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.5 1
ECMA-262, edition 3
General purpose scripting language 1.06ECMA-262
OpenLaszlo Platform
OpenLaszlo

OpenLaszlo is an open source platform for the development and delivery of rich Internet applications. It is released under the Open Source Initiative-certified Common Public License....
JavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.4 1
ECMA-262, edition 3 4
, JScript for game platforms 0.9.0ECMA-262, edition 3
iCab
ICab

iCab is a web browser for the Macintosh by Alexander Clauss, derived from Crystal Atari Browser for Atari TOS compatible computers. It is the only browser being developed for Mac OS 9 and earlier, and is the only one available for Motorola 68000 family-based Macintoshes that features tabbed browsing....
InScript
InScript

InScript is a closed-source library providing an ECMAScript engine for ECMA-262 3ed, written in C_Plus_Plus . It was used by the web browser iCab 2 and 3....
 3.22
ECMA-262, edition 3
Max/MSPJavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.5 1
ECMA-262, edition 3
ANT Galio with Venturi layout engine and SpiderPigJavaScript
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
 1.5 1 with RMAI extensions
ECMA-262, edition 3


Note (1): Mozilla manages the official version of JavaScript. Most non-Mozilla implementations claiming JavaScript "compliance" do not actually support most JavaScript extensions; rather, they target ECMA-262, edition 3.

Note (2): Microsoft asserts that JScript 8.0 supports "almost all of the features of the ECMAScript Edition 3 Language Specification" but does not list the unsupported features.

Note (3): In addition to supporting ECMA-262 edition 3, ActionScript 3 also included support for extensions proposed in drafts of ECMAScript edition 4.

Note (4): As of version 4, OpenLaszlo implements standard ECMAScript edition 3 with some extensions proposed in drafts of ECMAScript edition 4

Note (5): The current WebKit
WebKit

WebKit is an application framework that provides a foundation upon which to build a web browser. WebKit was originally derived by Apple Inc. from the Konqueror browser?s KHTML software library for use as the engine of Mac OS X?s Safari web browser, and has now been further developed by individuals from the KDE project, Apple, Nokia, Google,...
 binaries, as of April 2007, also implement at least part of the Javascript 1.6 extras

Note (6): The Mozilla implementations, (SpiderMonkey
SpiderMonkey

SpiderMonkey is the code name for the first ever JavaScript engine, written by Brendan Eich at Netscape Communications Corporation, later released as open source and now maintained by the Mozilla Foundation....
 in the C programming language
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and Rhino
Rhino (JavaScript engine)

Rhino is an open source JavaScript engine. It is developed entirely in Java and managed by the Mozilla Foundation. The Foundation also provides an implementation of JavaScript in C known as SpiderMonkey ....
 in the Java programming language
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
), are used in several third-party
Third-party software component

In computer programming, third party software component is a reusable software component developed to be either freely distributed or sold by an entity other than the original vendor of the development platform....
 programs, including the Yahoo! Widget Engine
Yahoo! Widget Engine

Yahoo! Widgets is a free application platform for Mac OS X and Microsoft Windows. The software was previously called Konfabulator, but after being acquired by computer services company Yahoo! it was rebranded....
 (Konfabulator) and the Macintosh system-level scripting language JavaScript OSA
JavaScript OSA

JavaScript OSA, , is a freeware inter-process communication scripting language for the Macintosh computer.JavaScript OSA uses the "core language" of the Mozilla implementation of the JavaScript programming language, ....
.

Note (7): Apple
Apple Computer

Apple Inc., formerly Apple Computer Inc., is an United States multinational corporation which designs and manufactures consumer electronics and software products....
's Safari
Safari (web browser)

Safari is a web browser developed by Apple Inc.. First released as a beta on January 7, 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3, commonly known as "OS X Panther." Apple has also made Safari the native browser for the iPhone OS....
 uses JavaScriptCore
WebKit

WebKit is an application framework that provides a foundation upon which to build a web browser. WebKit was originally derived by Apple Inc. from the Konqueror browser?s KHTML software library for use as the engine of Mac OS X?s Safari web browser, and has now been further developed by individuals from the KDE project, Apple, Nokia, Google,...
 which is based on the KDE
KDE

KDE is a free software project based around its flagship product, a desktop environment for Unix-like systems. The goal of the project is to provide basic desktop functions and applications for daily needs as well as tools and documentation for developers to write stand-alone applications for the system....
 KJS library.

Note (8): This implementation was asserted to support some extensions proposed in drafts of ECMAScript edition 4

Note (9): V8 implements ECMAScript as specified in ECMA-262, 3rd edition.

Version correspondence

The following table is based on and ; items on the same line are approximately the same language.

JavaScriptJScriptECMAScript
1.0 (Netscape 2.0, March 1996)1.0 (IE 3.0 - early versions, August 1996) 
1.1 (Netscape 3.0, August 1996)2.0 (IE 3.0 - later versions, January 1997) 
1.2 (Netscape 4.0-4.05, June 1997)  
1.3 (Netscape 4.06-4.7x, October 1998)3.0 (IE 4.0, Oct 1997)Edition 1 (June 1997) / Edition 2 (June 1998)
1.4 (Netscape Server only)4.0 (Visual Studio 6, no IE release) 
 5.0 (IE 5.0, March 1999) 
 5.1 (IE 5.01) 
1.5 (Netscape 6.0, Nov 2000; also
later Netscape and Mozilla
Mozilla

Mozilla was the official, public, original name of Mozilla Application Suite by the Mozilla Foundation, currently known as SeaMonkey internet suite....
 releases)
5.5 (IE 5.5, July 2000)Edition 3 (December 1999)
 5.6 (IE 6.0, October 2001) 
1.6 (Gecko 1.8, Firefox 1.5, November 2005) Edition 3, with some compliant enhancements: E4X
E4X

ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to Document Object Model interfaces that uses a simpler syntax for accessing XML documents....
, Array extras (e.g. Array.prototype.forEach), Array and String generics ()
1.7 (Gecko 1.8.1, Firefox 2, October 2006) Edition 3 plus all JavaScript 1.6 enhancements, plus Pythonic
Python (programming language)

Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive....
 generators and array comprehensions
List comprehension

A list comprehension is a Syntax of programming languages construct available in some programming languages for creating a list based on existing lists....
 ([a*a for (a in iter)]), block scope
Scope (programming)

In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes....
 with let, destructuring assignment (var [a,b]=[1,2]) ()
1.8 (Gecko 1.9, Firefox 3, June 2008) Edition 3 plus all JavaScript 1.7 enhancements, plus expression closures (function(x) x * x), generator expressions, and more ()
 JScript .NET
JScript .NET

JScript .NET is a .NET Framework programming language developed by Microsoft as a natural successor to Microsoft's Active Scripting language JScript....
 (ASP.NET
ASP.NET

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services....
; no IE release)
JavaScript 2.0 (Work in progress) Harmony (Work in progress; see the section "ECMAScript Harmony" below).


Future development

The proposed fourth edition of ECMA-262 (ECMAScript 4 or ES4) would have been the first major update to ECMAScript since the third edition was published in 1999. The specification (along with a reference implementation) was originally targeted for completion by October 2008. An of the language was released by the working group on October 22, 2007.

As of August 2008, the ECMAScript 4th edition proposal has been scaled back into a project codenamed ECMAScript Harmony.

Features

Features under discussion for a future edition (originally "ECMAScript 4"; now ECMAScript Harmony) include:
  • Classes
    Class (computer science)

    In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
  • A module system
  • Optional type annotations and static typing, probably using a structural type system
    Structural type system

    A structural type system is a major class of type system, in which type compatibility and equivalence are determined by the type's structure, and not through explicit declarations....
  • Generators
    Generator (computer science)

    In computer science, a generator is a special subroutine that can be used to control the iteration behaviour of a control flow#Loops. A generator is very similar to a function that returns an array, in that a generator has parameters, can be called, and generates a sequence of values....
     and iterator
    Iterator

    In computer science, an iterator is an object that allows a programmer to traverse through all the elements of a Collection , regardless of its specific implementation....
    s
  • Destructuring assignment
  • Algebraic data types


The intent of these features is partly to better support "programming in the large
Programming in the large

Introduction In software development, programming in the large and programming in the small describe two different approaches to writing software....
", and to let programmers sacrifice some of the script's ability to be dynamic for performance. For example, Tamarin — the virtual machine for ActionScript developed and open sourced by Adobe — has JIT compilation
Just-in-time compilation

In computing, just-in-time compilation , also known as dynamic translation, is a technique for improving the runtime performance of a computer program....
 support for certain classes of scripts.

Bug fixes and backwards compatibility

In addition to introducing new features, some ES3 bugs were proposed to be fixed in edition 4. . These fixes and others, and support for JSON
JSON

JSON , short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays ....
 encoding/decoding, have now been folded into the ECMAScript 3.1 specification.

History

Work started on Edition 4 after the ES-CP (Compact Profile) specification was completed, and continued for approximately 18 months where slow progress was made balancing the theory of Netscape's JavaScript 2 specification with the implementation experience of Microsoft's JScript .NET. After some time, the focus shifted to the E4X
E4X

ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to Document Object Model interfaces that uses a simpler syntax for accessing XML documents....
 standard.

The update has not been without controversy. In late 2007, a debate between Eich, now the Mozilla Foundation
Mozilla Foundation

The Mozilla Foundation is a non-profit organization that exists to support and provide leadership for the open source Mozilla project. The organization sets the policies that govern development, operate key infrastructure and control trademarks and other intellectual property....
's CTO, and Chris Wilson, Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
's platform architect for Internet Explorer
Internet Explorer

Windows Internet Explorer , commonly abbreviated to IE, is a series of graphical user interface web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995....
, became public on a number of blog
Blog

A blog is a type of website, usually maintained by an individual with regular entries of commentary, descriptions of events, or other material such as graphics or video....
s. Wilson cautioned that because the proposed changes to ECMAScript made it backwards incompatible in some respects to earlier versions of the language, the update amounted to "breaking the Web," and that stakeholders who opposed the changes were being "hidden from view". Eich responded by stating that Wilson seemed to be "repeating falsehoods in blogs" and denied that there was attempt to suppress dissent and challenging critics to give specific examples of incompatibility. He also pointed out that Microsoft Silverlight
Microsoft Silverlight

Microsoft Silverlight is a programmable web browser plugin that enables features such as animation, vector graphics and multimedia that characterizes rich Internet applications....
 and Adobe AIR rely on C# and ActionScript
ActionScript

ActionScript is a scripting language based on ECMAScript. ActionScript is used primarily for the development of websites and software using the Adobe Flash Player platform , but is also used in some database applications , and in basic robotics, as with the Make Controller Kit....
 3 respectively, both of which are larger and more complex than ECMAScript Edition 3.

ECMAScript 3.1

Microsoft, Yahoo, and other 4th edition dissenters formed their own subcommittee to design a less ambitious update of ECMAScript 3, tentatively named ECMAScript 3.1. This edition would focus on security and library updates with a large emphasis on compatibility. After the aforementioned public sparring, the ECMAScript 3.1 and ECMAScript 4 teams agreed on a compromise: the two editions would be worked on in parallel, with coordination between the teams to ensure that ECMAScript 3.1 remains a strict subset of ECMAScript 4 in both semantics and syntax.

However, the differing philosophies in each team resulted in repeated breakages of the subset rule, and it remained doubtful that the ECMAScript 4 dissenters would ever support or implement ECMAScript 4 in the future. After over a year since the disagreement over the future of ECMAScript within the ECMA Technical Committee 39, the two teams reached a new compromise: ECMA TC39 announced it would focus work on the ECMAScript 3.1 project with full collaboration of all parties, and it would target two interoperable implementations by early 2009.

ECMAScript Harmony

In the same announcement, ECMA TC39 also stated that the ECMAScript 4 proposal would be superseded by a new project, code-named ECMAScript Harmony. ECMAScript Harmony will include syntactic extensions, but the changes will be more modest than ECMAScript 4 in both semantic and syntactic innovation. Packages, namespaces and early binding from ECMAScript 4 are no longer included for planned releases. In addition, other goals and ideas from ECMAScript 4 are being rephrased to keep consensus in the committee; these include a notion of classes based on existing ECMAScript 3 concepts combined with proposed ECMAScript 3.1 extensions. As of August 2008, there is no publicly announced release date for ECMAScript Harmony. Depending on how ECMAScript 3.1 is officially named, ECMAScript Harmony may end up being the new ECMAScript 4th edition.

See also

  • ActionScript
    ActionScript

    ActionScript is a scripting language based on ECMAScript. ActionScript is used primarily for the development of websites and software using the Adobe Flash Player platform , but is also used in some database applications , and in basic robotics, as with the Make Controller Kit....
  • Comparison of layout engines (ECMAScript)
    Comparison of layout engines (ECMAScript)

    The following tables compare ECMAScript support for a number of layout engines. Please see the individual products' articles for further information....
  • Document Object Model
    Document Object Model

    The Document Object Model is a platform- and programming language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface for querying, traversing and manipulating such documents....
  • E4X
    E4X

    ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to Document Object Model interfaces that uses a simpler syntax for accessing XML documents....
  • List of ECMAScript engines
    List of ECMAScript engines

    The following is a list of ECMAScript engines.*InScript*WebKit — a JavaScript interpreter that was originally derived from KDE's JavaScript engine....
  • JavaScript
    JavaScript

    JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....


External links

  • : John Resig's map on ECMAScript