V8, A 4.2L, Twin Turbo Node.js

Philip Jonas
2 min readJun 8, 2021

Wait, what are you talking about? Well its simple to be honest, V8 is the engine the drives Node.js written in C++, to really get into the gritty side of V8 you can read more about it at https://v8.dev/.

So, think of V8 as the engine of the car, which is very apt based on the name, and well the surrounding parts is the Node.Js code. Everything you do in the code is managed by the V8 engine, but to understand V8 you need a little bit of knowledge of what Node.Js is.

What is Node.Js?

Node.Js allows for the execution of JavaScript outside of the web browser in a server. It is essentially server side JavaScript. Because JavaScript runs from the top down, we have two types of JavaScript Events that take place, Synchronous and Asynchronous events, we will reference these as Sync and Async events.

Once the Node process is started it will run through the JavaScript and if none of these calls are Async, once it gets to the end the node process will stop. However, Async calls are added to a process queue. When the node process gets to the end of the JavaScript it will then look at then look to see if there are any events in the Queue, if there are the script will enter a loop state and at the start of that loop it will process the queue. It will continue this process until all the Async events have been processed before sleeping.

The most common Async process we get is the http server, this will keep the process active as it will always look for updates to the http server and requests.

So then what is V8?

Lets think of V8 as a translator for Node.js, you see computers follow instructions using Machine Code and well JavaScript is not machine code and this is what V8 does, it converts JavaScript into machine code. It allows you to code server instructions in JavaScript for a computer.

So when you run your node server using the node process like so:

$>node index.js

What you are then doing is starting a node process the is built on the V8 engine to run your JavaScript on the server.

Further Reading:
https://nodejs.org/en/about/
https://v8.dev/
https://en.wikipedia.org/wiki/V8_(JavaScript_engine)

--

--