What is JavaScript written in?

The major JavaScript engines are written in C++. Google's V8 (used in Chrome and Node.js), Mozilla's SpiderMonkey, and Apple's JavaScriptCore are all implemented in C++. The JavaScript language specification is defined by ECMAScript and doesn't mandate any particular implementation language.

Quick Facts

Short answer
Modern JavaScript engines are mostly C++
Specification
ECMAScript
Major engines
V8, SpiderMonkey, JavaScriptCore
Historical note
Original SpiderMonkey began in C

Details

JavaScript itself is a language standard, defined by ECMAScript. The useful implementation question is about JavaScript engines: the programs that parse, compile, optimize, and execute JavaScript code.

While the very first JavaScript engine was written in C, most modern major engines use C++ for performance-critical compiler and runtime code. V8 powers Chrome and Node.js, SpiderMonkey powers Firefox, and JavaScriptCore powers Safari and WebKit-based environments.

Major JavaScript engines

EngineWritten inWhere it runs
V8C++Chrome, Node.js, Deno, Electron
SpiderMonkeyC++, Rust, JavaScriptFirefox
JavaScriptCoreC++Safari and WebKit

The dataset keeps the historical C relationship for the original SpiderMonkey implementation, while the modern engine pages document C++-based implementations such as V8 and JavaScriptCore.

Explore in the Graph

See implementation and influence relationships interactively.

Open Interactive Graph →

Related Pages