JavaScript engine
Encyclopedia
A JavaScript engine is specialized computer software
Computer software
Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it....

 which interprets
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

 and executes JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 (or ECMAScript
ECMAScript
ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known dialects such as JavaScript, JScript, and ActionScript.- History :JavaScript...

). Although there are several uses for a JavaScript engine, it is most commonly used in web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

s.

History

Before the second browser war
Browser wars
Browser wars is a metaphorical term that refers to competitions for dominance in usage share in the web browser marketplace. The term is often used to denote two specific rivalries: the competition that saw Microsoft's Internet Explorer replace Netscape's Navigator as the dominant browser during...

 in 2008-2009, the JavaScript engine (also known as JavaScript interpreter or JavaScript implementation) was known simply as an interpreter that read and executed JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

.

The first JavaScript engine was created by Brendan Eich
Brendan Eich
Brendan Eich is a computer programmer and creator of the JavaScript scripting language. He is the chief technology officer at the Mozilla Corporation.-Education:...

 at Netscape Communications Corporation for the Netscape Navigator
Netscape Navigator
Netscape Navigator was a proprietary web browser that was popular in the 1990s. It was the flagship product of the Netscape Communications Corporation and the dominant web browser in terms of usage share, although by 2002 its usage had almost disappeared...

 web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

. The engine, code named SpiderMonkey
SpiderMonkey
SpiderMonkey is the code name for the first-ever JavaScript engine, written by Brendan Eich at Netscape Communications, later released as open source and now maintained by the Mozilla Foundation.-History:Eich "wrote JavaScript in ten days" in 1995,...

, is implemented in C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

. It has since been updated (in JavaScript 1.5) to conform to ECMA-262 Edition 3. The 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 another implementation of JavaScript engine written in C known as SpiderMonkey....

 engine, created primarily by Norris Boyd (also at Netscape) is a JavaScript implementation in Java
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 platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

. Like SpiderMonkey, Rhino is ECMA-262 Edition 3 compliant. Applications of the technology include Apple Safari 4's Nitro, Google Chrome's V8
V8 (JavaScript engine)
The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

 and Mozilla Firefox 3.5's TraceMonkey.

By far the most common host environment for JavaScript is a web browser. Web browsers typically use the public API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 to create "host objects" responsible for reflecting the DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

 into JavaScript.

The web server
Web server
Web server can refer to either the hardware or the software that helps to deliver content that can be accessed through the Internet....

 is another common application of the engine. A JavaScript web server
Server-side JavaScript
Server-side JavaScript refers to JavaScript that runs on the server-side. This term was coined because the language is predominantly used on the client-side, i.e. client-side JavaScript ....

 exposes host objects representing a HTTP request and response objects, which a JavaScript program then manipulates to dynamically generate web pages. Microsoft's ASP technology for IIS allows server-side code to be written in VB Script or JScript (Microsoft's implementation of JavaScript). Jaxer is a web server that runs entirely on JavaScript; this has the benefit of allowing the same code to be shared on the server and on the client.

Performance evolution

A typical major browser has a graphical engine and an independent JavaScript engine, which allows for easier testing, reimplementation or usage in other projects. For example Carakan is used with Presto; Nitro with WebKit; SpiderMonkey with Gecko; KJS with KHTML; Rhino by default has no layout engine. Other combinations are possible, for example, V8 with WebKit in Google Chrome. The JavaScript engine gives developers access to functionality (networking, DOM handling, external events, HTML5 video, canvas and data storage) needed to control the web browser.

Sunspider is a JavaScript benchmark utility
Browser speed test
A browser speed test is a computer benchmark to measure the performance of the JavaScript engine of a web browser. In general the software is available online, located on a website, where different algorithms are loaded and performed in the browser client...

 for measuring the performance of JavaScript engines in more than a dozen tests, each concentrating on different part of JavaScript language. Sunspider does not use for benchmarking any features beyond those needed to test pure computations (no HTML, no CSS, no networking).

The JavaScript engine race: 2008 and 2009

Recently there has been a race by browser developers to develop even faster JavaScript engines in response to the growing usage of javascript frameworks and ajax, as the user's experience is directly influenced by the browser's ability to execute the site's client-side code. In 2008, Google Chrome
Google Chrome
Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

 was praised for its JavaScript performance, but other browsers soon received new JavaScript engines which were faster. Later, Google Chrome
Google Chrome
Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

 won in the races of better performance. Chrome's strength is its application performance and JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 processing speed, both of which were independently verified by multiple websites to be the fastest amongst the major browsers of its time. With the advent of WebKit's Squirrelfish and Mozilla's TraceMonkey JavaScript virtual machines, Chrome's JavaScript execution performance has been found to be slower. Google responded with the Danish developed V8
V8 (JavaScript engine)
The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

 which boosted JS performance in Google Chrome 2.

On June 2, 2008 the WebKit development team announced SquirrelFish, a then-new JavaScript engine that vastly improves Safari's speed at interpreting scripts. The engine was one of the new features in Safari 4, released for developers on June 11, 2008; the final JavaScript engine was called Nitro.

In January 2009 the engine then known as SquirrelFish Extreme (SFX) was enabled for Mac OS X on x86-64
X86-64
x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...

 architectures as it passes all tests on that platform by Apple Inc.
Released June 30, 2009 Firefox 3.5
Mozilla Firefox 3.5
Mozilla Firefox 3.5 is a version of the Firefox web browser released in June 2009, adding a variety of new features to Firefox. Version 3.5 was touted as being twice as fast as 3.0...

 includes the optimization technique which offered "performance improvements ranging between 20 and 40 times faster" compared to Firefox 3 in some cases.

The JavaScript engine race: 2010

In early 2010 the Norwegian Opera
Opera (web browser)
Opera is a web browser and Internet suite developed by Opera Software with over 200 million users worldwide. The browser handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, chatting on IRC, downloading files via BitTorrent,...

 browser replaced the aging Futhark with the faster Carakan, which was 2.5 times faster in early testing Others in the race at this time include Apple's Safari's Nitro (the engine formerly known as SquirrelFish), and Firefox's new JägerMonkey (a "cross-child of Nitro with the older TraceMonkey Engine"). Microsoft lagged behind, lacking a dedicated JavaScript engine and being the slowest of the major browsers, although by mid-2010 they held out the carrot of Chakra
Chakra (JScript engine)
Chakra is a JScript engine developed by Microsoft for its Internet Explorer 9 web browser. A distinctive feature of the 32-bit version of the engine is that it JIT compiles scripts on a separate CPU core, parallel to the web browser...

 in then unreleased Internet Explorer 9
Internet Explorer 9
Windows Internet Explorer 9 is the current version of the Internet Explorer web browser from Microsoft. It was released to the public on March 14, 2011 at 21:00 PDT. Internet Explorer 9 supports several CSS 3 properties, embedded ICC v2 or v4 color profiles support via Windows Color System, and...

. JägerMonkey began testing in the publicly released Firefox 4.0 beta in the Summer of 2010. Safari 5, also released in summer 2010, featured 30 percent faster JavaScript performance than Safari 4 (using the Nitro engine).

2011

In 2011 Firefox 4 and Internet Explorer 9
Internet Explorer 9
Windows Internet Explorer 9 is the current version of the Internet Explorer web browser from Microsoft. It was released to the public on March 14, 2011 at 21:00 PDT. Internet Explorer 9 supports several CSS 3 properties, embedded ICC v2 or v4 color profiles support via Windows Color System, and...

 were released with their JavaScript software.

Mozilla

  • 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 another implementation of JavaScript engine written in C known as SpiderMonkey....

    , managed by the Mozilla Foundation, open source, developed entirely in Java
  • SpiderMonkey (code name), the first ever JavaScript engine, written by Brendan Eich at Netscape Communications
  • TraceMonkey, the engine promoted with Firefox 3.5
  • JägerMonkey
    JägerMonkey
    JägerMonkey is a JavaScript engine released for Firefox 4 and later versions. It has "Method JIT" and a new assembler based on Safari's Nitro...

    , the engine promoted with Firefox 4.
  • IonMonkey, JIT compiler optimization for SpiderMonkey.
  • Tamarin
    Tamarin (JavaScript engine)
    Tamarin is a free virtual machine with just-in-time compilation support intended to implement the fourth edition of the ECMAScript standard....

    , by Adobe Labs
    Adobe Systems
    Adobe Systems Incorporated is an American computer software company founded in 1982 and headquartered in San Jose, California, United States...


Google

  • V8
    V8 (JavaScript engine)
    The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

     - open source, developed by Google in Denmark, part of Google Chrome

Opera

  • Carakan, by Opera Software
    Opera Software
    Opera Software ASA is a Norwegian software company, primarily known for its Opera family of web browsers with over 220 million users worldwide. Opera Software is also involved in promoting Web standards through participation in the W3C. The company has its headquarters in Oslo, Norway and is...

    , used since Opera
    Opera (web browser)
    Opera is a web browser and Internet suite developed by Opera Software with over 200 million users worldwide. The browser handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, chatting on IRC, downloading files via BitTorrent,...

     10.50
  • Futhark, by Opera Software
    Opera Software
    Opera Software ASA is a Norwegian software company, primarily known for its Opera family of web browsers with over 220 million users worldwide. Opera Software is also involved in promoting Web standards through participation in the W3C. The company has its headquarters in Oslo, Norway and is...

    , replaced by Carakan in Opera 10.50 (released March 2010)

Safari

  • JavaScriptCore, renamed to SquirrelFish and marketed as Nitro, for Safari
    Safari (web browser)
    Safari is a web browser developed by Apple Inc. and included with the Mac OS X and iOS operating systems. First released as a public 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 "Panther". Safari is also the...


Other

  • KJS - KDE's ECMAScript/JavaScript engine originally developed by Harri Porten
    Harri Porten
    Harri Porten is a software engineer. Porten, a KDE developer and former Trolltech employee, is the CEO of Froglogic, a consultancy company related to Qt development. He currently lives in Hamburg, Germany. Porten originally wrote the KJS JavaScript engine for Konqueror, the KDE project's file...

     for the KDE project's Konqueror web browser
  • Narcissus
    Narcissus (JavaScript engine)
    Narcissus is an open source JavaScript engine. It was written by Brendan Eich, who also wrote the first JavaScript engine, SpiderMonkey. Its name is based on the mythical figure of Narcissus, who fell in love with himself...

     open source, written by Brendan Eich, who also wrote SpiderMonkey
  • Chakra, for Internet Explorer 9
    Internet Explorer 9
    Windows Internet Explorer 9 is the current version of the Internet Explorer web browser from Microsoft. It was released to the public on March 14, 2011 at 21:00 PDT. Internet Explorer 9 supports several CSS 3 properties, embedded ICC v2 or v4 color profiles support via Windows Color System, and...

  • dyn.js, open source, written by Douglas Campos and others
  • Nashorn
    Nashorn (JavaScript engine)
    Nashorn is an upcoming JavaScript engine, developed entirely in Java by Oracle Corporation. It will be based on JSR 292 and will be available for Java 8 in late 2012. The project has been announced first at the JVM language summit in July 2011., and then confirmed at JavaOne in October 2011-See...

    , open source (pending), written by Oracle Java Languages and Tool Group

Implementations

JavaScript is a dialect of ECMAScript
ECMAScript
ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known dialects such as JavaScript, JScript, and ActionScript.- History :JavaScript...

, which is supported in many applications, especially web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

s. 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...

 and related API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

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 .Founded and headed by Tim Berners-Lee, the consortium is made up of member organizations which maintain full-time staff for the purpose of working together in the development of standards for the...

-specified DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

. This means that an application written in one dialect may be incompatible with another, unless the applications 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 language/dialect.
Application Dialect and latest version ECMAScript edition
Google Chrome
Google Chrome
Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

, the V8
V8 (JavaScript engine)
The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

 engine
JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

ECMA-262, edition 5
Mozilla Firefox
Mozilla Firefox
Mozilla Firefox is a free and open source web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. , Firefox is the second most widely used browser, with approximately 25% of worldwide usage share of web browsers...

, the Gecko
Gecko (layout engine)
Gecko is a free and open source layout engine used in many applications developed by Mozilla Foundation and the Mozilla Corporation , as well as in many other open source software projects....

 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 another implementation of JavaScript engine written in C known as SpiderMonkey....

JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.8.5
ECMA-262, edition 5
Opera
Opera (web browser)
Opera is a web browser and Internet suite developed by Opera Software with over 200 million users worldwide. The browser handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, chatting on IRC, downloading files via BitTorrent,...

ECMAScript with some JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.5
and JScript
JScript
JScript is a scripting language based on the ECMAScript standard that is used in Microsoft's Internet Explorer.JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages,...

 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 forked version of KHTML called WebKit is used by several web browsers, among them Safari and Google Chrome...

 layout engine, KDE's Konqueror
Konqueror
Not to be confused with the Conqueror web browser.Konqueror is a web browser and file manager that provides file-viewer functionality for file systems such as local files, files on a remote ftp server and files in a disk image. It is a core part of the KDE desktop environment...

, and Apple's Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. and included with the Mac OS X and iOS operating systems. First released as a public 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 "Panther". Safari is also the...

JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.5
ECMA-262, edition 3
Adobe Acrobat
Adobe Acrobat
Adobe Acrobat is a family of application software developed by Adobe Systems to view, create, manipulate, print and manage files in Portable Document Format . All members of the family, except Adobe Reader , are commercial software, while the latter is available as freeware and can be downloaded...

JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.5
ECMA-262, edition 3
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 prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.4
ECMA-262, edition 3
Max/MSP JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.5
ECMA-262, edition 3
ANT Galio 3
Fresco (web browser)
ANT Fresco was a proprietary, embedded web browser produced by , a software development firm headquartered in Cambridge, United Kingdom. Fresco was superseded by Galio in 2004....

JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.5 with RMAI extensions
ECMA-262, edition 3

External links

  • Are We Fast Yet? - A daily comparison of bleeding-edge JavaScript engines for Mozilla Firefox
    Mozilla Firefox
    Mozilla Firefox is a free and open source web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. , Firefox is the second most widely used browser, with approximately 25% of worldwide usage share of web browsers...

    , Google Chrome
    Google Chrome
    Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

     and Apple Safari.
  • Peacekeeper – Browser speed test
  • Speed-Battle – Online JavaScript speed test
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK