List of JavaScript engines
The first engines for JavaScript were mere interpreters of the source code, but all relevant modern engines use just-in-time compilation for improved performance. JavaScript engines are typically developed by web browser vendors, and every major browser has one. In a browser, the JavaScript engine runs in concert with the rendering engine via the Document Object Model and Web IDL bindings. However, the use of JavaScript engines is not limited to browsers; for example, the V8 engine is a core component of the Node.js runtime system. They are also called ECMAScript engines, after the official name of the specification. With the advent of WebAssembly, some engines can also execute this code in the same sandbox as regular JavaScript code.
History
The first JavaScript engine was created by Brendan Eich in 1995 for the Netscape Navigator web browser. It was a rudimentary interpreter for the nascent language Eich invented.Google debuted its Chrome browser in 2008, introducing the V8 JavaScript engine that was at the time much faster than its competition.
This sparked a race between browser vendors to deliver ever-faster JavaScript engines.
The key innovations around this era were switching from basic tree-walking interpreters to stack- and register-based bytecode VM interpreters, just-in-time compilation, inline caching and generational GC.
Apple released the JIT-enabled Nitro engine in June 2008 for its Safari browser, which had 30% better performance than its predecessor. Mozilla followed suit in August 2008 with TraceMonkey, the first JIT compiler for SpiderMonkey engine, released in Firefox 3.1. Opera joined the performance race with their register-bytecode based and JIT-enabled Carakan engine, announced in February 2009 and released in April 2010. Microsoft's first JIT-enabled Chakra engine, in development since 2008, debuted as part of Internet Explorer 9 in 2011. Its major rewrite appeared in Microsoft Edge Legacy in 2015 and open-sourced as ChakraCore in 2016.
Further performance gains in major JavaScript engines were later achieved with the introduction of multi-tiered JIT architectures. Progressively advanced JIT compilers are used to optimize hotspots in user code, with each next tier delivering ever more performant native code at the cost of slower compile time. Chrome was the first to implement it in V8 in 2010 with the introduction of Crankshaft, a 2-tiered JIT compiler. By 2023, architecture of V8 evolved into 4 tiers: Ignition – register-based bytecode interpreter, Sparkplug – a fast non-optimizing JIT compiler, Maglev and TurboFan – slower optimizing JIT compilers. JavaScriptCore today has a similar 4-tier architecture, while Firefox's SpiderMonkey and ChakraCore have 3 tiers. This ever-increasing complexity of JIT compilers, however, has been criticized as a rich source of browser bugs, prompting some browser vendors to disable JIT altogether, such as Microsoft Edge's "Super Duper Secure Mode", introduced in 2021 and reportedly with minor performance impact for daily browsing.
V8's influence expanded beyond browsers with the release of Node.js in 2009 and its package manager npm in 2010. As their popularity exploded, V8 also became the engine powering vast amounts of server-side JavaScript code. In 2013, Electron framework appeared that let developers create desktop apps with web technologies as well, using Chromium with V8 and Node.js under the hood.
Taking advantage of performance improvements in JavaScript engines, Emscripten C/C++-to-JavaScript compiler appeared in 2010-2011 and allowed running existing complex C/C++ code, such as game engines and even whole virtual machines, directly in the browser. asm.js, a highly optimizable low-level subset of JavaScript for such compilers emerged in 2013, with Firefox being the first to implement specific optimizations for it with OdinMonkey module. Eventually asm.js and NaCl evolved into WebAssembly standard in 2017, with all major engines adding support for it.
The six-year gap between ECMAScript 5 and ES6 marked a major inflection point for JavaScript engine development. Whereas ES5 was a relatively compact language with straightforward basic implementation, ES6 introduced foundations of modern JavaScript, with substantially increased complexity, as well as an annual release cycle for new specification versions. This put the focus not only on performance optimization, but also on keeping pace with the rapidly evolving standards and led to a consolidation around engines that had the resources to do it. Many smaller projects did not end up fully implementing ES6 spec, and Opera and Microsoft both ceased developing their engines and adopted V8 in 2013 and 2021. Nashorn engine was dropped from OpenJDK over a similar concern about ECMAScript's rapid development.
List
| Engine | License | Standard | JIT | Wasm | Written in | Description |
| V8 | C++ | JavaScript engine of Google Chrome and Chromium/Blink-based browsers, such as Microsoft Edge. Also used in Node.js and Deno runtimes, Electron framework and numerous other projects. Currently has a register-based bytecode interpreter and three tiers of JIT compilers. | ||||
| SpiderMonkey | C++ | JavaScript engine of Firefox and other Mozilla Gecko applications. The engine currently includes interpreter, 2-tier JIT for JavaScript, and a separate 2-tier JIT for WebAssembly. Previously, the engine included components such as the TraceMonkey compiler, JägerMonkey, IonMonkey, as well as OdinMonkey optimization module notable for pioneering asm.js. | ||||
| JavaScriptCore | C++ | JavaScript engine of Safari and WebKit-based browsers. Also used in Bun runtime. Started out in 2001 as a fork of KJS engine. In 2008 the engine was rewritten to use a direct-threaded register-based bytecode interpreter, codenamed SquirrelFish. Shortly after, SquirrelFish Extreme was released, achieving over 2x speedup over it by using polymorphic inline caching and context threading – a basic form of JIT. These components later became LLint bytecode interpreter and Baseline JIT. In 2011, the first optimizing compiler was added – DFG JIT. In 2014, an advanced LLVM-based compiler was added, dubbed Fourth Tier LLVM JIT. In 2016, FTL was rewritten to use a newly built B3 backend instead of LLVM. | ||||
| ChakraCore | C++ | JavaScript engine of Microsoft Edge Legacy. Open-sourced under the name ChakraCore in 2016. Microsoft discontinued maintenance in 2021, leaving it to the community, but it has received little attention since then. It features a register-based bytecode interpreter and a two-tier JIT compiler. | ||||
| LibJS | C++ | JavaScript engine of the SerenityOS and Ladybird browser. Initially a basic AST-walking interpreter, later upgraded to a register-based bytecode VM interpreter. Supports WebAssembly via LibWasm library. | ||||
| Rhino | Java | JavaScript engine from Mozilla for the Java platform. Development started at Netscape in 1997. Originally it compiled JavaScript to JVM bytecode, but the implementation was inefficient and it was mainly used in interpreter mode. Bundled in JDK 6 as javax.script. In JDK 8 it was replaced by the faster Nashorn engine. Despite this, the project continues development and implemented support for many parts of newer standards. Used in RingoJS runtime. | ||||
| Nashorn | Java | JavaScript engine from Oracle used in JDK 8–14. Generates more efficient JVM bytecode than Rhino, taking advantage of the new invokedynamic instruction introduced in JDK 7. Deprecated in JDK 11 due to maintenance challenges owing to fast evolution of ECMAScript standard, and removed in JDK 15. Development continues till today as a standalone library. | ||||
| GraalJS | Java | JavaScript engine of GraalVM for JVM platform. Implemented with Truffle, a novel language framework for automatically deriving high-performance code from interpreters, based on the idea of partial evaluation of interpreters. Generally much faster than both Rhino and Nashorn, with performance comparable to major browser engines. Supports WebAssembly via GraalWasm module. | ||||
| Hermes | C++ | Developed by Facebook for React Native mobile apps, but can also be used independent from React Native. Precompiles JavaScript to optimized bytecode ahead-of-time to improve app start-up time. Static Hermes project aims to add sound static typing and JavaScript-to-native code compilation – both currently experimental, as well as various improvements to VM – the latter released as Hermes V1 in React Native 0.82. | ||||
| Duktape | C | A small footprint, easily embeddable ES5 engine with some features from ES6 and later. Used by NetSurf browser. | ||||
| XS | C | JavaScript engine for microcontrollers with limited resources, compliant with latest ECMAScript versions. Originally developed by Kinoma and first open-sourced in 2015 as a key component of their KinomaJS IoT framework. Now maintained by Moddable as part of the Moddable SDK. | ||||
| MuJS | C | A lightweight ECMAScript interpreter library, designed for embedding in other software to extend them with scripting capabilities. Originally developed for MuPDF. | ||||
| QuickJS | C | A lightweight ECMAScript engine by Fabrice Bellard and Charlie Gordon, currently featuring almost complete support of ES2023. Implements a stack-based bytecode VM interpreter and a single-pass AST-free direct-to-bytecode compiler. Can precompile.js to bytecode ahead-of-time and produce a binary executable with no external dependencies. Used in WinterJS and Amazon's LLRT runtimes, CouchDB, nginx, yt-dlp. | ||||
| V4 | C++ | JavaScript engine of Qt's QML framework, powering UI of modern Qt applications, Qt Quick, KDE Plasma. Initially appeared in Qt 5.0 as a wrapper for V8, later replaced by Qt's lightweight home-grown "V4" engine in Qt 5.2 ES7/ES2016-compliant and JIT-enabled, using macroassembler code borrowed from JavaScriptCore. Only used for QML, not for the embedded browser engine modules: QtWebKit module used JavaScriptCore, later succeeded by Blink/V8-based QtWebEngine. | ||||
| Espruino | C | A very small footprint interpreter specifically for microcontrollers. Can run in less than 8 kB of RAM by executing from source. | ||||
| JerryScript | C | Ultra-lightweight JavaScript engine by Samsung for microcontrollers with less than 64 KB RAM. Supports ES5 and large parts of recent standards up to ES2022. | ||||
| Escargot | C++ | A newer lightweight JavaScript engine by Samsung for resource-constrained environments, targeting mid-range devices like phones and TVs. Under active development, fully supports latest ECMAScript standard except a few minor features, as well as WebAssembly. Implements a register-based VM interpreter. | ||||
| otto | Go | JavaScript engine in pure Go, implementing ES5 but with non-compliant regex engine from Go. | ||||
| Goja | Go | JavaScript engine in pure Go, inspired by otto, fully implementing ES5 and parts of newer standards. Used by Ethereum's official Go implementation. | ||||
| Boa | Rust | A JavaScript engine written in Rust. | ||||
| Kiesel | Zig | JavaScript engine by Linus Groh written in Zig. | ||||
| engine262 | TypeScript | A JavaScript engine written in TypeScript for development and exploration, intended essentially as a reference implementation of the language. |