Runtime environment

I wanted to know what is a runtime environment, and why nodejs is called runtime environment for js. Don't c and cpp languages use it. And also is there a way I can improve my basic knowledge that includes these terms
4 Replies
13eck
13eck3mo ago
Nodejs is a “runtime environment” because it’s the environment that runs the JavaScript engine. In Node, that’s Chrome’s V8. Node is written using the C library libuv and V8 itself is written in C++, so while those two languages are involved in Node those languages don’t use Node. Just like how in your Chrome browser the browser itself is the runtime environment with V8 being the engine that reads and executes Js code.
Aditya
AdityaOP3mo ago
Is there a way I can improve my basic knowledge that includes these terms so that I know how things are working. Or if I don't have to focus on these things and just build things Is there a way I can improve my basic knowledge that includes these terms so that I know how things are working. Or if I don't have to focus on these things and just build things
13eck
13eck3mo ago
Right now, just build things. Get comfortable with JavaScript. Only worry about the runtime when you want/need to know how JS objects work. For example, you don’t need to know how the Math object works to use it, you just type Math.random() and get a random number between 0 and not-1, for example. But if/when you want to know how that random number is created then you look into how the runtime does things. It’s also important to note that some JS methods have only a result specified and not any implementation. So what V8 does can be different then SpiderMonkey (which I’d where Firefox uses).
StefanH
StefanH3mo ago
Runtime environment is an annoyingly indirect word for "the program that runs your script". Your script doesn't do anything on its own. It isn't machine code after all. You need another program to run it. And that can be a browser or something else like node, deno or bun

Did you find this page helpful?