0

As a junior developer; I always heard that JavaScript is interpreted by Node.js/V8 which runs on C++. That the JavaScript code is interpreted by a program rather than directly being compiled by the CPU. Taking a look at the node.js docs it says the following (https://nodejs.dev/learn/the-v8-javascript-engine)

JavaScript is internally compiled by V8 with just-in-time (JIT) compilation to speed up the execution.

Which leads to my question, does Node.js/V8 compile javascript directly by the CPU? Are there cases then where JavaScript is still interpreted rather than compiled? For so long I've always heard JavaScript is a interpreted language, but now it seems that for most use cases e.g. the web that JavaScript should be considered a compiled language.

  • no Node.js/V8 which doesn't runs on C++, it's run in assembly – Mister Jojo Jun 11 '21 at 22:41
  • 1
    "*being compiled by the CPU*" - compilation rarely happens on the GPU… Did you mean to write "…rather than directly being **interpreted** by the CPU"? ("Interpreted" and "executed" are interchangeable here) – Bergi Jun 11 '21 at 23:02

0 Answers0