List of JavaScript engines

Last updated

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. [1] 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. [2] 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. [3] 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. [4] [3]

Contents

History

The first JavaScript engine was created by Brendan Eich in 1995 for the Netscape Navigator web browser. [5] It was a rudimentary interpreter for the nascent language Eich invented. [6] (This evolved into the SpiderMonkey engine, still used by the Firefox browser. [5] )

Google debuted its Chrome browser in 2008, introducing the V8 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 basic tree-walking interpreters to stack- and register-based bytecode VM interpreters, just-in-time compilation (JIT), inline caching (hidden classes) 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. [10] [11] Mozilla followed the 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-enabled Carakan engine, announced in February 2009 [13] and released in April 2010. [14] Microsoft's first JIT-enabled Chakra engine, in development since 2008, [15] 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. [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 as Microsoft 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 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. [22] [23] 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. [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 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. [25] Eventually asm.js and NaCl (a competing Google's technology) evolved into WebAssembly standard in 2017, with all major engines adding support for it. [4]

The six-year gap between ECMAScript 5 (2009) and ES6 (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, and Opera and Microsoft 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]

List

EngineLicense Standard JIT WASM Written inDescription
V8 BSD-3-Clause ESnextYesYes 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 (Ignition) and three tiers of JIT compilers (Sparkplug, Maglev and Turbofan).
SpiderMonkey MPL-2.0 ESnextYesYes C++ JavaScript engine of Firefox and other Mozilla Gecko applications. The engine currently includes interpreter, 2-tier JIT for JavaScript (Baseline Compiler and WarpMonkey), and a separate 2-tier JIT for WebAssembly (WASM-Baseline or RabaldrMonkey, and WASM-Ion or BaldrMonkey). [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 pioneering asm.js. [25]
JavaScriptCore LGPL-2.0, parts under BSD ESnextYesYes 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 (Nitro in Apple's marketing terms) [29] was released, achieving over 2x speedup over it by using polymorphic inline caching and context threading [30] – a basic form of JIT. [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 advanced LLVM-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]
KJS LGPL-2.0+ ES5NoNo C++ The engine originally used in Konqueror, and one component of KHTML. 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. [36] 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. [37]
JScript Proprietary ES3NoNoThe engine that is used in Internet Explorer for versions up to IE9, and one component of the MSHTML (Trident) browser engine.
JScript .NET Proprietary ES3via CLR NoA .NET Framework JScript engine developed by Microsoft and used in ASP.NET based on Common Language Runtime and COM Interop. Support was dropped with .NET Core and CoreCLR so its future looks questionable for ASP.NET Core.
Chakra (JScript9) Proprietary ES5YesNo C++ A JScript engine used in Internet Explorer. It was first previewed at MIX 10 as part of the Internet Explorer 9 Platform Preview. [38]
ChakraCore MIT ES6 (partial)YesYes C++ JavaScript engine of Microsoft Edge Legacy. [39] 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]
Linear A,
Linear B,
Futhark
Proprietary ES3NoNo C++ A series of early JavaScript engines of Opera 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). [40]
Carakan Proprietary ES5YesNo C++ JavaScript engine of Opera from 10.50 release in 2010 until the switch to V8 with Opera 15 in 2013. [13] [41] [26] It featured register-based bytecode and JIT. [13]
Rhino MPL-2.0 ES6 (partial)via JVM No 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. [42] Bundled in JDK 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 parts of newer standards. Used in RingoJS runtime.
Nashorn GPL-2.0 ES6 (partial)via JVM No Java JavaScript engine from Oracle used in JDK 8–14. [44] Generates more efficient JVM bytecode than Rhino, taking advantage of the new invokedynamic instruction introduced in JDK 7. [45] Deprecated in JDK 11 (2018) due to maintenance challenges owing to fast evolution of ECMAScript standard, [28] and removed in JDK 15 (2020). [46] Development continues till today as a standalone library. [47]
QtScript LGPL, GPL, Qt ES5 dialectNoNo C++ Originally developed by Trolltech, now owned by The Qt Company. First appeared in Qt 4.3, deprecated in Qt 5.5 in favor of QML'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.
Espruino MPL-2.0 ES5 (subset)NoNo C A very small footprint interpreter specifically for microcontrollers. Can run in less than 8 kB of RAM by executing from source (rather than bytecode).
JerryScript Apache-2.0 ES2022 (mostly)NoNo 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.
Boa MIT, Unlicense ESnextNoNo Rust A JavaScript engine written in Rust. [48] [49]
Epimetheus MPL-1.1 GPL-2.0+ LGPL-2.1+ ES3, ES4 (draft)NoNo C++ Netscape's experimental "JavaScript 2.0" implementation towards ES4 proposal. [50] [51]
Tamarin MPL-2.0 ES3, ES4 (draft)YesNo C++ ActionScript and ECMAScript engine used in Adobe Flash Player 9. Implemented ES4 proposal.
Links GPL-2.0+ NoNoNo C Links browser had a basic JavaScript implementation until version 2.1pre28. Removed in 2.1pre29 for being "very buggy". [52]
Voyager GPL-3.0ES3NoNo C Voyager, another web browser for Amiga in the late 1990s – early 2000s, had its own JavaScript engine.
ScriptEase Proprietary ES3 [53] NoNo C++ An old proprietary engine last updated in 2003. Only notable for its use in the James Webb Space Telescope. [54]
  Discontinued or dead projects

See also

References

  1. Looper, Jen (21 September 2015). "A Guide to JavaScript Engines for Idiots". Telerik Developer Network. Archived from the original on 8 December 2018. Retrieved 8 December 2018.
  2. "How Blink Works". Google. Retrieved 12 March 2024.
  3. 1 2 "Documentation · V8". Google. Retrieved 3 March 2024.
  4. 1 2 Nelaturu, Keerthi. "WebAssembly: What's the big deal?". medium.com. Retrieved 3 March 2024.
  5. 1 2 Eich, Brendan (21 June 2011). "New JavaScript Engine Module Owner".
  6. Fin JS (17 June 2016), "Brendan Eich – CEO of Brave", YouTube, retrieved 7 February 2018
  7. "Big browser comparison test: Internet Explorer vs. Firefox, Opera, Safari and Chrome". PC Games Hardware. Computec Media AG. 3 July 2009. Archived from the original on 2 May 2012. Retrieved 28 June 2010.
  8. Purdy, Kevin (11 June 2009). "Lifehacker Speed Tests: Safari 4, Chrome 2". Lifehacker . Archived from the original on 14 April 2021. Retrieved 8 May 2021.
  9. "Mozilla asks, 'Are we fast yet?'". Wired. Archived from the original on 22 June 2018. Retrieved 18 January 2019.
  10. Safari 5 Released
  11. Shankland, Stephen (2 March 2010). "Opera 10.5 brings new JavaScript engine". CNET. CBS Interactive. Archived from the original on 3 October 2013. Retrieved 30 January 2012.
  12. "TraceMonkey: JavaScript Lightspeed, Brendan Eich's Blog". Archived from the original on 4 December 2015. Retrieved 22 July 2020.
  13. 1 2 3 "Carakan". Archived from the original on 31 May 2009. Retrieved 9 July 2009.
  14. https://archive.nytimes.com/www.nytimes.com/external/readwriteweb/2010/03/02/02readwriteweb-opera-1050-a-browser-worth-switching-to-88992.html
  15. https://www.tenforums.com/windows-10-news/32685-microsoft-edge-s-javascript-engine-go-open-source.html
  16. "A New Crankshaft for V8". Chromium Blog. 7 December 2010. Retrieved 22 April 2011.
  17. https://v8.dev/blog/maglev
  18. 1 2 https://webkit.org/blog/10308/speculation-in-javascriptcore
  19. 1 2 https://firefox-source-docs.mozilla.org/js/index.html
  20. 1 2 https://github.com/chakra-core/ChakraCore/wiki/Architecture-Overview
  21. https://microsoftedge.github.io/edgevr/posts/Super-Duper-Secure-Mode/
  22. "Deno 2 Arrives with Long-Term Support, Node.js Compatibility". The New Stack. 19 June 2024. Retrieved 25 August 2025.
  23. Camden, Raymond K. (2015). Apache Cordova in Action. Manning. pp. 2–15. ISBN   9781617292392.
  24. "Electron Internals: Using Node as a Library". electronjs.org. 8 August 2016. Archived from the original on 9 November 2017. Retrieved 3 July 2020.
  25. 1 2 https://techcrunch.com/2013/12/21/mozillas-asm-js-gets-another-step-closer-to-native-performance/
  26. 1 2 https://web.archive.org/web/20140628054037/https://dev.opera.com/blog/300-million-users-and-move-to-webkit/
  27. New Microsoft Edge to replace Microsoft Edge Legacy with April's Windows 10 Update Tuesday release, Microsoft, 12 February 2021, archived from the original on 11 March 2021, retrieved 12 March 2021
  28. 1 2 https://openjdk.org/jeps/335
  29. "JavaScriptCore – WebKit".
  30. https://web.archive.org/web/20250514082037/https://webdocs.cs.ualberta.ca/~amaral/cascon/CDP05/slides/CDP05-berndl.pdf
  31. https://webkit.org/blog/214/introducing-squirrelfish-extreme/
  32. 1 2 https://webkit.org/blog/10308/speculation-in-javascriptcore/
  33. https://trac.webkit.org/changeset/94559/webkit
  34. https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit/
  35. https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/
  36. https://blogs.kde.org/2008/05/22/news-land-konquerors/
  37. https://lwn.net/Articles/963851/
  38. Frequently Asked Questions, Microsoft, 13 March 2010, archived from the original on 22 March 2010, retrieved 18 March 2010
  39. "Targeting Edge vs. Legacy Engines in JsRT APIs" . Retrieved 10 September 2015.
  40. https://help.opera.com/en/operas-archived-history/
  41. "Opera Desktop Team's Blog | Opera". Archived from the original on 3 March 2006.
  42. "Rhino History". Mozilla Foundation. Archived from the original on 22 October 2020. Retrieved 20 March 2008.
  43. https://openjdk.org/jeps/174
  44. "Oracle Nashorn: A Next-Generation JavaScript Engine for the JVM".
  45. https://www.oracle.com/technetwork/java/jvmls2013lager-2014150.pdf
  46. https://openjdk.org/jeps/372
  47. "Using Nashorn with different Java versions". GitHub . Retrieved 23 January 2025.
  48. "Let's build a JavaScript Engine". 2019.jsconf.eu. Retrieved 23 March 2022.
  49. "GitHub - boa-dev/boa: Boa is an embeddable and experimental Javascript engine written in Rust". github.com. Retrieved 8 April 2022.
  50. Wirfs-Brock, Allen; Eich, Brendan (2020). "JavaScript: the first 20 years". Proceedings of the ACM on Programming Languages. 4 (HOPL). doi:10.1145/3386327.
  51. https://www-archive.mozilla.org/js/language/epimetheus
  52. http://links.twibright.com/download/ChangeLog
  53. https://joehni.github.io/JsUnit/products.html
  54. Clark, Mitchell (18 August 2022). "The James Webb Space Telescope runs JavaScript, apparently". The Verge. Retrieved 2 September 2022.