The Node.js ecosystem is huge and thanks to it V8 also powers desktop apps, with projects like Electron.
Other JS engines
- Firefox has Spidermonkey
- Edge has Chakra
and many others exist as well.
The Chrome V8 engine :
- The V8 engine is written in C++ and used in Chrome and Nodejs.
- It implements ECMAScript as specified in ECMA-262.
- The V8 engine can run standalone we can embed it with our own C++ program.
So for example:
Node.js in itself is a C++ implementation of a V8 engine allowing server side programming and networking applications.
Let’s now look at some of the open source code inside the engine. To do this, you need to go to the v8/samples/shell.cc folder .
Here you can see the implementation of different functions such as
Read, which are natively not available in Node.js.
The quest for performance
V8 is written in C++, and it’s continuously improved. It is portable and runs on Mac, Windows, Linux and several other systems.
In this V8 introduction, I 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.
On the web, there is a race for performance that’s been going on for years, and we (as users and developers) benefit a lot from this competition because we get faster and more optimized machines year after year.
JavScript is internally compiled by V8 with just-in-time (JIT) compilation to speed up the execution.
Our applications now can run for hours inside a browser, rather than being just a few form validation rules or simple scripts.