In this V8 introduction, we will ignore the implementation details of V8: they can be found on more authoritative sites (e.g. the V8 official site), and they change over time, often radically.
Other JS engines
- Firefox has SpiderMonkey
- Edge was originally based on Chakra but has more recently been rebuilt using Chromium and the V8 engine.
and many others exist as well.
V8 is written in C++, and it’s continuously improved. It is portable and runs on Mac, Windows, Linux and several other systems.
Our applications now can run for hours inside a browser, rather than being just a few form validation rules or simple scripts.
When a developer runs a JS script on V8, the following steps are taken by the engine:
- The engine compiles and executes the JS code
- The engine handles the call stack
- The engine manages the memory heap
- The engine handles the garbage collection
- The engine provides all the data types, objects and functions
- The engine also provides the event loop (sometimes implemented by the browser as well)
- It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors.
- V8 can run standalone, or can be embedded into any C++ application.