The firstengines forJavaScript were mereinterpreters of thesource code, but all relevant modern engines usejust-in-time compilation for improved performance.[1] JavaScript engines are typically developed byweb browser vendors, and every major browser has one. In a browser, the JavaScript engine runs in concert with therendering engine via theDocument Object Model andWeb IDL bindings.[2] However, the use of JavaScript engines is not limited to browsers; for example, theV8 engine is a core component of theNode.jsruntime system.[3] They are also calledECMAScript engines, after the official name of the specification. With the advent ofWebAssembly, some engines can also execute this code in the samesandbox as regular JavaScript code.[4][3]
The first JavaScript engine was created byBrendan Eich in 1995 for theNetscape Navigatorweb browser.[5] It was a rudimentaryinterpreter for the nascent language Eich invented.[6] (This evolved into theSpiderMonkey engine, still used by theFirefox browser.[5])
Google debuted itsChrome browser in 2008, introducing theV8 JavaScript engine that was at the time much faster than its competition.[7][8]This sparked a race between browser vendors to deliver ever-faster JavaScript engines.[9]The key innovations around this era were switching from basictree-walking interpreters tostack- andregister-basedbytecodeVM interpreters,just-in-time compilation (JIT),inline caching (hidden classes) andgenerational GC.Apple released the JIT-enabledNitro engine in June 2008 for itsSafari browser, which had 30% better performance than its predecessor.[10][11]Mozilla followed suit in August 2008 with TraceMonkey, the first JIT compiler for SpiderMonkey engine, released in Firefox 3.1.[12]Opera joined the performance race with their register-bytecode based and JIT-enabledCarakan engine, announced in February 2009[13] and released in April 2010.[14] Microsoft's first JIT-enabledChakra engine, in development since 2008,[15] debuted as part ofInternet Explorer 9 in 2011. Its major rewrite appeared inMicrosoft Edge Legacy in 2015 and open-sourced asChakraCore 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.[16] 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.[17] JavaScriptCore today has a similar 4-tier architecture,[18] while Firefox's SpiderMonkey and ChakraCore have 3 tiers (interpreter and 2-tiered JIT).[19][20] 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 asMicrosoft Edge's "Super Duper Secure Mode", introduced in 2021 and reportedly with minor performance impact for daily browsing.[21]
V8's influence expanded beyond browsers with the release ofNode.js in 2009 and its package managernpm in 2010. As their popularity exploded, V8 also became the engine powering vast amounts of server-side JavaScript code.[22][23] In 2013,Electron framework appeared that let developers create desktop apps with web technologies as well, usingChromium with V8 andNode.js under the hood.[24]
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 asgame engines and even wholevirtual machines, directly in the browser.asm.js, a highly optimizable low-level subset of JavaScript for such compilers emerged in 2013, withFirefox being the first to implement specific optimizations for it with OdinMonkey module.[25] Eventually asm.js andNaCl (a competing Google's technology) evolved intoWebAssembly standard in 2017, with all major engines adding support for it.[4]
The six-year gap betweenECMAScript 5 (2009) andES6 (2015) 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 (of both ECMAScript and wider web ecosystem) 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, andOpera andMicrosoft both ceased developing their engines and adopted V8 in 2013 and 2021.[26][27] Nashorn engine was dropped from OpenJDK over a similar concern about ECMAScript's rapid development.[28]
| Engine | License | Standard | JIT | Wasm | Written in | Description |
|---|---|---|---|---|---|---|
| V8 | BSD-3-Clause | ESnext | Yes | Yes | C++ | JavaScript engine ofGoogle Chrome andChromium/Blink-based browsers, such asMicrosoft Edge. Also used inNode.js andDenoruntimes,Electron framework and numerous other projects. Currently has aregister-basedbytecode interpreter (Ignition) and three tiers of JIT compilers (Sparkplug, Maglev and Turbofan). |
| SpiderMonkey | MPL-2.0 | ESnext | Yes | Yes | C++ | JavaScript engine ofFirefox and other MozillaGecko applications. The engine currently includes interpreter, 2-tier JIT for JavaScript (Baseline Compiler and WarpMonkey), and a separate 2-tier JIT for WebAssembly.[19] Previously, the engine included components such as the TraceMonkey compiler (first JavaScript JIT), JägerMonkey, IonMonkey, as well as OdinMonkey optimization module notable for pioneeringasm.js.[25] |
| JavaScriptCore | LGPL-2.0, parts underBSD | ESnext | Yes | Yes | C++ | JavaScript engine ofSafari andWebKit-based browsers. Also used inBun runtime. Started out in 2001 as a fork ofKJS engine. In 2008 the engine was rewritten to use adirect-threaded register-based bytecode interpreter, codenamed SquirrelFish. Shortly after, SquirrelFish Extreme (Nitro in Apple's marketing terms)[29] was released, achieving over 2x speedup over it by using polymorphicinline caching andcontext threading[30] – a basic form ofJIT.[31] These components later became LLint bytecode interpreter and Baseline JIT.[32] In 2011, the first optimizing compiler was added – DFG ("Data Flow Graph") JIT.[32][33] In 2014, an advancedLLVM-based compiler was added, dubbed Fourth Tier LLVM (FTL) JIT.[34] In 2016, FTL was rewritten to use a newly built B3 backend instead of LLVM.[35][18] |
| ChakraCore | MIT | ES2019 | Yes | Yes | C++ | JavaScript engine ofMicrosoft Edge Legacy.[36] 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.[20] |
| LibJS | BSD-2-Clause | ESnext | No | Yes | C++ | JavaScript engine of theSerenityOS andLadybird browser.[37] Initially a basic AST tree-walking interpreter, later upgraded to a register-based bytecode VM interpreter.[38][39][40][41] Supports WebAssembly via LibWasm library. |
| Rhino | MPL-2.0 | ES2023 (partial) | via JVM | No | Java | JavaScript engine fromMozilla for theJava 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.[42] Bundled inJDK 6 (2006) as javax.script. In JDK 8 (2014) it was replaced by the faster Nashorn engine.[43] Despite this, the project continues development and implemented support for many parts of newer standards.[44] Used in RingoJS runtime. |
| Nashorn | GPL-2.0 | ES6 (partial) | via JVM | No | Java | JavaScript engine fromOracle used inJDK 8–14.[45] Generates more efficientJVM bytecode than Rhino, taking advantage of the newinvokedynamic instruction introduced in JDK 7.[46] Deprecated in JDK 11 (2018) due to maintenance challenges owing to fast evolution of ECMAScript standard,[28] and removed in JDK 15 (2020).[47] Development continues till today as a standalone library.[48] |
| GraalJS | GFTC, UPL-1.0 | ESnext | viaGraalVM | Yes | Java | JavaScript engine ofGraalVM forJVM platform. Implemented with Truffle, a novel language framework for automatically deriving high-performance code from interpreters, based on the idea ofpartial evaluation of interpreters (Futamura projection).[49][50] Generally much faster than both Rhino and Nashorn, with performance comparable to major browser engines.[51] Supports WebAssembly via GraalWasm module. |
| Hermes | MIT | ES6+ (partial) | No | No | C++ | Developed byFacebook forReact Native mobile apps,[52] but can also be used independent from React Native. Precompiles JavaScript to optimized bytecodeahead-of-time to improve app start-up time.[53][54][41] |
| Duktape | MIT | ES6 (partial) | No | No | C | A small footprint, easily embeddable ES5 engine with some features from ES6 and later.[55][56][57][58] Used byNetSurf browser. |
| XS | LGPL-3.0+,Apache-2.0 | ESnext | No | No | C | JavaScript engine for microcontrollers with limited resources, compliant with latest ECMAScript versions.[59][60][58][41][61] Originally developed byKinoma 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.[62] |
| MuJS | ISC | ES5 | No | No | C | A lightweight ECMAScript interpreter library, designed for embedding in other software to extend them with scripting capabilities. Originally developed forMuPDF.[63][56] |
| QuickJS | MIT | ES2023 | No | No | C | A lightweight ECMAScript engine byFabrice Bellard and Charlie Gordon, currently featuring almost complete support of ES2023.[64][56][53][65][41] Implements a stack-based bytecode VM interpreter and a single-pass AST-free direct-to-bytecode compiler. Can precompile .js to bytecodeahead-of-time and produce a binary executable with no external dependencies. Used in WinterJS andAmazon's LLRT runtimes,CouchDB,nginx (as alternative to njs),yt-dlp. |
| V4 (QJSEngine) | LGPL,GPL,Qt | ES2016 | Yes | No | C++ | JavaScript engine ofQt'sQML framework, powering UI of modern Qt applications,Qt Quick,KDE Plasma.[66][67][68][69] Initially appeared in Qt 5.0 (2012) as a wrapper for V8,[70] later replaced by Qt's lightweight home-grown "V4" engine in Qt 5.2 (2013)[71][72] ES7/ES2016-compliant[73] and JIT-enabled, using macroassembler code borrowed from JavaScriptCore.[74][75] Only used for QML, not for the embedded browser engine modules: QtWebKit module used JavaScriptCore, later succeeded byBlink/V8-based QtWebEngine. |
| Espruino | MPL-2.0 | ES5 (subset) | No | No | C | A very small footprint interpreter specifically formicrocontrollers.[57] Can run in less than 8 kB of RAM by executing from source (rather thanbytecode). |
| JerryScript | Apache-2.0 | ES2022 | No | No | C | Ultra-lightweight JavaScript engine bySamsung for microcontrollers with less than 64 KB RAM.[56][58] Supports ES5 and large parts of recent standards up to ES2022. |
| Escargot | LGPL-2.1 | ESnext | No | Yes | C++ | A newer lightweight JavaScript engine bySamsung 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.[76][56][77] Implements a register-based VM interpreter. |
| otto | MIT | ES5 | No | No | Go | JavaScript engine in pure Go, implementing ES5 but with non-compliant regex engine from Go. |
| Goja | MIT | ES2023 (partial) | No | No | Go | JavaScript engine in pure Go, inspired by otto, fully implementing ES5 and parts of newer standards. Used byEthereum's official Go implementation (Geth).[78] |
| Boa | MIT,Unlicense | ESnext | No | No | Rust | A JavaScript engine written inRust.[79][80] |
| Kiesel | MIT | ESnext | No | No | Zig | JavaScript engine by Linus Groh written inZig.[81][82][83][84] |
| engine262 | MIT | ESnext | No | No | TypeScript | A JavaScript engine written in TypeScript for development and exploration, intended essentially as a reference implementation of the language.[41] |
These engines have been discontinued and are mostly interesting for the historical perspective. Some may still be in use today for legacy purposes (especially Microsoft's old engines that continue to ship withWindows).
| Engine | License | Standard | JIT | Written in | Description |
|---|---|---|---|---|---|
| Mocha | Proprietary | JS1.1 (≈ES1) | No | C++ | The first JavaScript engine. Prototyped byBrendan Eich in a 10-day sprint in May 1995 and shipped in September 1995 inNetscape Navigator 2.0b1.[85] Due to feature freeze in August 1995, it was incomplete relative to the envisioned language design. Version 1.1 was released with Navigator 3.0 in 1996, completing the initial development of the language and served as the basis for the first edition ofECMAScript standard in 1997. The engine had arecursive descent parser that directly emittedbytecode, a stack-based virtual machine, usedreference counting instead ofGC and represented primitives as discriminated unions rather than tagged pointers. Source code as part of Navigator 3.0.2 is available fromInternet Archive.[86] For Navigator 4.0, the engine was completely rewritten and renamed SpiderMonkey.[87] |
| KJS | LGPL-2.0+ | ES5 | No | C++ | The engine originally used inKonqueror, and one component ofKHTML. Predecessor to JavaScriptCore, which forked it in 2001 and significantly diverged since. Originally an AST-tree-walking interpreter, upgraded to a bytecode interpreter (FrostByte) in 2008.[88] Development largely stopped as Konqueror transitioned from KHTML first to QtWebKit (JavaScriptCore) and then QtWebEngine (V8).KDE Plasma 6 finally removed KJS/KHTML engine altogether.[89] |
| JScript | Proprietary | ES3 | No | C++[90] | JavaScript engine ofInternet Explorer 3.0 - 8.0. One component of theMSHTML (Trident)browser engine. |
| JScript .NET | Proprietary | ES4 | via CLR | JavaScript engine for.NET Framework 1.0 - 4.x developed byMicrosoft, used inASP.NET, based onCommon Language Runtime andCOM Interop. Originally introduced as JScript .NET in 2000,[91] with later versions called JScript 7.0, JScript 8.0[92] and, finally, JScript 10.0 in .NET Framework 4.0.[93] However, it is unrelated to both JScript (aka JScript 1.0 - 5.8) and JScript9 engines.[92] It supports ES3, many of the features proposed for ES4,[87] as well as many unique .NET-related dialectisms.[94][95] Dropped from.NET Core and the modern.NET platform. | |
| Chakra (JScript9) | Proprietary | ES5 | Yes | C++ | JavaScript engine ofInternet Explorer 9.0 - 11.0. It was first previewed in 2010 atMIX 10.[96] Still ships in Windows 11 as JScript9Legacy.dll, a drop-in compatible replacement for the original JScript engine (jscript.dll).[97][98] |
| Linear A, Linear B, Futhark | Proprietary | ES3 | No | C++ | A series of early JavaScript engines ofOpera browser. Unnamed engine in Opera 3 (1997–2000). Linear A in Opera 4–6 (2000–2002). Linear B in Opera 7–9.27 (2002–2007) – implemented complete ECMAScript support. Futhark in Opera 9.50-10.20 (2007–2010).[99] |
| Carakan | Proprietary | ES5 | Yes | C++ | JavaScript engine ofOpera10.50 - 12.x (2010–2013).[13][100] It featured register-based bytecode and JIT.[13] The next major release, Opera 15, switched from Presto toWebKit/Blink browser engine along with itsV8 JavaScript engine.[26] |
| QtScript | LGPL,GPL,Qt | ES5 | No | C++ | Originally developed by Trolltech, now owned byThe Qt Company. First appeared inQt 4.3, deprecated in Qt 5.5 in favor ofQML's V4 and then dropped in Qt 6.5. Based on JavaScriptCore engine and featured a few Qt-specific ECMAScript extensions, such as QObject-style signal and slot connections. |
| Epimetheus | MPL-1.1GPL-2.0+LGPL-2.1+ | ES4 | No | C++ | Netscape's experimental "JavaScript 2.0" implementation towardsES4 proposal.[87][101] |
| Tamarin | MPL-2.0 | ES4 | Yes | C++ | ActionScript and ECMAScript engine used inAdobe Flash Player 9. ImplementedES4 proposal. |
| Narcissus | MPL-1.1+GPL-2.0+LGPL-2.1+ | ES5 | No | JavaScript | JavaScript engine implemented in JavaScript (ameta-circular evaluator) byBrendan Eich, the creator of JavaScript. Used for experimentation with new language features for ES6 efforts.[87] |
| Links | GPL-2.0+ | No | No | C | Links browser had a basic JavaScript implementation until version 2.1pre28. Removed in 2.1pre29 for being "very buggy".[102] |
| Voyager | GPL-3.0 | ES3 | No | C | Voyager, another web browser forAmiga in the late 1990s – early 2000s, had its own JavaScript engine. |
| ScriptEase | Proprietary | ES3[103] | No | C++ | An old proprietary engine last updated in 2003. Only notable for its use in theJames Webb Space Telescope.[104] |