2

On the homepage of Node.js, It's clearly said --

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

I was trying to understand, what actually is a "runtime built". After some googling, I got some idea on this.

Please check my understandings and correct me anywhere if I got it wrong. If I got the whole thing wrong, please explain it elaborately.

A program runtime is a specific time duration, in which the program got itself executed.

We know, Node.js ships with pre-compiled binary program, which runs the JS program. It's built on Chrome's V8 JS engine which is written on C++. Node.js run a JS program directly and compiles it to machine code. Then OS execute this machine code. Every step I told earlier, happens in node program runtime.

This is why Node.js is called "a javascript runtime built". Because Node binary built the JS program to machine code and OS executes it. And all these happen during the time when I run a JS program/file with node.

node myJs.js
// Hello World

Thanks in advance.

1
  • Please, thoroughly read the question title and question details first before answering. Commented Jun 19, 2017 at 5:22

2 Answers 2

3

Node.js is a JavaScript runtime. It's built on Chrome's v8 engine.

Sign up to request clarification or add additional context in comments.

2 Comments

I also know, Node.js is a JavaScript runtime and built on Chrome's v8 engine. But my question is "Why"? I've had tried to find the "why's" answer. Please check the answer. If my answer is wrong, then correct me.
Node.js combined Google's V8 JavaScript engine, an event loop and a low-level I/O API. See "Professional Node.js: Building JavaScript Based Scalable Software", John Wiley & Sons, 01-Oct-2012
1

See what my understanding​ calls runtime as is below:

Chrome's javascript runtime = google's V8 engine​.

V8 = JS runtime

Nodejs = V8 (i.e your js runtime) + web apis(for operations not present in V8 codebase) + task queue(for async stuff)

What JS runtime(V8) is : it provides memory allocation using heap and maintains a stack which is supposed to orderize the list of Operations​ to be performed as. instructed by code.

Every binding is done at runtime ( at the time of execution ) and at the core if Nodejs is V8 ( JS runtime) V8 provides the run-time for JavaScript . Might help you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.