JavaScript engine
AJavaScript engineis asoftware componentthat executesJavaScriptcode.The first JavaScriptengineswere mereinterpreters,but all relevant modern engines usejust-in-time compilationfor improved performance.[1]
JavaScript engines are typically developed byweb browservendors, and every major browser has one. In a browser, the JavaScript engine runs in concert with therendering enginevia theDocument Object ModelandWeb IDLbindings.[2]However, the use of JavaScript engines is not limited to browsers; for example, theV8 engineis a core component of theNode.jsruntime system.[3]
SinceECMAScriptis the standardized specification of JavaScript,ECMAScript engineis another name for theseimplementations.With the advent ofWebAssembly,some engines can also execute this code in the samesandboxas regular JavaScript code.[4][3]
History
[edit]The first JavaScript engine was created byBrendan Eichin 1995 for theNetscape Navigatorweb browser.[5]It was a rudimentaryinterpreterfor the nascent language Eich invented.[6](This evolved into theSpiderMonkeyengine, still used by theFirefoxbrowser.[5])
Googledebuted itsChromebrowser in 2008, with theV8JavaScript engine that was faster than its competition.[7][8]The key innovation wasjust-in-time compilation(JIT), whichMozillahad also been working on for SpiderMonkey.[9]Because of V8's performance, the other browser vendors needed to overhaul their engines for JIT.[10]Appledeveloped theNitroengine for itsSafaribrowser, which had 30% better performance than its predecessor.[11]Mozilla then leveraged portions of Nitro to improve SpiderMonkey.[12]
Since 2017, these engines have added support forWebAssembly.[4]
Notable engines
[edit]- V8fromGoogleis the most used JavaScript engine.Google Chromeand the many otherChromium-based browsers use it, as doapplicationsbuilt withCEF,Electron,or any otherframeworkthat embeds Chromium. Other uses include theNode.jsandDenoruntime systems.
- SpiderMonkeyis developed byMozillafor use inFirefoxand itsforks.TheGNOME Shelluses it for extension support.
- JavaScriptCoreisApple's engine for itsSafaribrowser. OtherWebKit-based browsers and theBunruntime system also use it.KJSfromKDEwas the starting point for its development.[13]
- Chakrais the engine of theInternet Explorerbrowser. It was also forked byMicrosoftfor the originalEdgebrowser, but Edge was later rebuilt as a Chromium-based browser and thus now uses V8.[14][15]
References
[edit]- ^Looper, Jen (21 September 2015)."A Guide to JavaScript Engines for Idiots".TelerikDeveloper Network. Archived fromthe originalon 8 December 2018.Retrieved8 December2018.
- ^"How Blink Works".Google.Retrieved12 March2024.
- ^ab"Documentation · V8".Google.Retrieved3 March2024.
- ^abNelaturu, Keerthi."WebAssembly: What's the big deal?".medium.Retrieved3 March2024.
- ^abEich, Brendan (21 June 2011)."New JavaScript Engine Module Owner".
- ^Fin JS (17 June 2016),"Brendan Eich – CEO of Brave",YouTube,retrieved7 February2018
- ^"Big browser comparison test: Internet Explorer vs. Firefox, Opera, Safari and Chrome".PC Games Hardware.Computec Media AG. 3 July 2009.Archivedfrom the original on 2 May 2012.Retrieved28 June2010.
- ^Purdy, Kevin (11 June 2009)."Lifehacker Speed Tests: Safari 4, Chrome 2".Lifehacker.Archivedfrom the original on 14 April 2021.Retrieved8 May2021.
- ^"TraceMonkey: JavaScript Lightspeed, Brendan Eich's Blog".Archivedfrom the original on 4 December 2015.Retrieved22 July2020.
- ^"Mozilla asks, 'Are we fast yet?'".Wired.Archivedfrom the original on 22 June 2018.Retrieved18 January2019.
- ^Safari 5 Released
- ^Shankland, Stephen (2 March 2010)."Opera 10.5 brings new JavaScript engine".CNET.CBS Interactive. Archived fromthe originalon 3 October 2013.Retrieved30 January2012.
- ^Stachowiak, Maciej (9 November 2008)."Companies and Organizations that have contributed to WebKit".WebKit Wiki.Retrieved13 April2019.
- ^Belfiore, Joe (15 January 2020),New year, new browser – The new Microsoft Edge is out of preview and now available for download,Microsoft
- ^"Microsoft Edge and Chromium Open Source: Our Intent".Microsoft Edge Team. 6 December 2018.Retrieved8 December2018.