V8 (source code)
= V8
{c}
<V8> is an open-source engine implementing <JavaScript> through <ECMAScript> and also executing <WebAssembly>. It can be embedded in applications, so the engine and the application supplying its environment are distinct components.<V8 project overview>[What is V8?, supported languages and application embedding]{ref}
For a simple language-level example, `[1, 2, 3].map(x => x * x)` evaluates to an array containing `1, 4, 9`. The specified array and multiplication behavior belongs to <ECMAScript>; V8 supplies an implementation of that behavior. The same expression does not require a document or a <web browser>.
The project's <d8> developer shell supplies a small environment for running programs. A file containing `console.log(6 * 7);` prints `42` when run in that shell. The multiplication is language behavior, whereas the output facility is supplied by the environment.<Using d8 in the V8 documentation>[Print to the command line, JavaScript files and console.log]{ref}
V8 includes <Ignition (JavaScript interpreter)>, a register-based <interpreter>. Interpreter machinery, <bytecode> and compilation strategies concern how an engine executes a program, rather than changing the program's specified mathematical result.<Ignition in the V8 documentation>[Opening description, register-based interpreter]{ref}
An embedding application can supply additional objects and functions. A <Document Object Model> operation therefore depends on a suitable host, not merely on the presence of V8. Likewise, a performance comparison must name the engine version, workload and measurement conditions rather than treating one fast numerical expression as a measurement of an entire application.
Back to article page