Interpreter: A (core) module part of the language runtime / virtual machine which takes specific 'actions' against a set of expressions expressed in the language whose virtual machine the module is.

Compiler: A (core) module part of the language runtime which 'converts' a set of expressions expressed in the language whose compiler the module is, into a set of instructions native to the architecture where the expressions are run against.

Standard Node.js is built against V8, which compiles every Javascript code snippet into native instructions. You may use --print_code flag in the command line to see which scripts are getting compiled, and compiled into what.

Hope this helps.

Answer from Gireesh Punathil on Stack Overflow
🌐
Quora
quora.com › Is-Node-js-compiled-or-interpreted
Is Node.js compiled or interpreted? - Quora
I think this question is a bit ambiguous, but since both answers are simple, I’ll answer both possibilities. Node.js itself is compiled. It is built upon C++. Native Node.js modules are usually also implemented in C++ and compiled a...
🌐
LinkedIn
linkedin.com › pulse › demystifying-nodejs-interpreters-compilers-jit-sabyasachi-gupta-m8rtc
Demystifying Node.js: Interpreters, Compilers, and JIT Compilation
March 9, 2024 - Contrasting with interpreters, compilers translate the entire source code of a program into machine code before it's executed. This process involves analyzing the source code, optimizing it, and generating an intermediate representation (IR).
🌐
Replit
replit.com › languages › nodejs
Node.js Online Compiler & Interpreter - Replit
Write and run Node.js code using our Node.js online compiler & interpreter. You can build, share, and host applications right from your browser!
🌐
Reddit
reddit.com › r/node › [question] is nodejs really interpreted?
r/node on Reddit: [Question] Is NodeJS really interpreted?
April 9, 2016 -

Better question

If NodeJS is interpreted and not compiled, then why do I have to restart the server after every change?

Let's say I'm using Express, why can't I modify a method and simply reload the URL like PHP or Perl? Why do I have to keep restarting the server all the time?

Top answer
1 of 5
17
Modifying running code is actually a very complicated problem for programming languages that allow for mutable data structures. Interpreted or compiled has nothing to do with it. With Perl and PHP, you are restarting the program every time. Each and every time the URL is loaded, the program is started, run, and terminated. There are efficiency problems with this. Starting a process isn't free, or even cheap in some cases. There are performance gains to be had in keeping the process open. NodeJS takes advantage of some of those optimizations. Of course, there are advantages to spawning processes. Ease of development is one of them. There are tools like nodemon to help you with this, by automatically restarting the server when file changes are detected. I think webpack can do this, too.
2 of 5
8
Better question This question is bound to cause confusion related to what constitutes a "compiled" language and what constitutes an "interpreted" language. So much misinformation and misunderstanding in this thread. For the record, just because /some/ PHP or Perl /scripts/ allow you to reload the URL do not mean that /all/ PHP or Perl /applications/ are configured thusly. Modern perl applications written using Plack/PSGI work in much the same way as Node. There is an application server that reads the perl script, creates the abstract syntax tree, and then stays running, handling requests in a loop. It's not async (although there are event loop libraries for perl), but it works the same as you are describing. Restarting the server is necessary to pick up any changes to the perl source. Note that I didn't say perl was "interpreted", because it's not. Perl source code is read, parsed, and then converted to an in-memory abstract syntax tree and that syntax tree is then interpreted. Perl is often called "interpreted" because it's not a traditional compiled language whereby a compiler generates object code and that object code is executed instead. Each new execution of perl causes it to read a plain text file on disk and compile it to the syntax tree instead of executing raw machine code like what is contained within an ELF binary. (By the way, you can get that with perl by using perlcc ) The V8 engine used by Node has a similar intermediate step, but it goes even further. V8 actually compiles JavaScript to machine code. That machine code is what is executed. It is not interpreted. Edit: it's not really a terrible question, but the answer is ... not as ... plain ... as the question implies. Edit2: Mention something about event loop libraries for perl (POE, AnyEvent, libuv, Glib, Event, et. al.)
🌐
Nestedquotes
nestedquotes.ca › articles › compiler-nodejs
Writing a Compiler in Node.js
The compiler world has become blurry, with many popular languages compiling to intermediate languages executing on cross-platform virtual machines like C# and Java. The V8 engine in Chrome and Node.js uses both Interpreters and multiple compilers to ...
🌐
Hashnode
hashnode.com › post › is-nodejs-compiled-or-interpreted-language-cijylh0ed00keco5318e1em8p
Is Node.js compiled or interpreted language? - Hashnode
January 28, 2016 - I was going through the docs and couple of answers here n there. I noticed that V8 compiles our code into machine code. So, is Node.js interpreted or compiled?
🌐
Medium
medium.com › @shivam.artoonsolution › understanding-nodejs-compiler-a-comprehensive-guide-d0ae65389960
Understanding Nodejs Compiler: A Comprehensive Guide | by Shivam Artoonsolution | Medium
July 26, 2024 - V8 JavaScript Engine: The heart of Node.js, V8 is an open-source JavaScript engine developed by Google. It compiles JavaScript code into machine code at runtime, providing fast execution and efficient memory usage. Just-In-Time (JIT) Compilation: Unlike traditional compilers that convert the entire codebase into machine code before execution, JIT compilers translate code on-the-fly as it is needed. This approach balances the benefits of interpreted ...
Find elsewhere
🌐
W3Schools
w3schools.com › nodejs › nodejs_compiler.asp
Node.js Online Compiler (Editor / Interpreter)
If you don't know Node.js, we suggest that you read our Node.js Tutorial from scratch. Get an overview of your packages and easily add or delete frameworks and libraries.
🌐
OneCompiler
onecompiler.com › nodejs
NodeJS Online Compiler
OneCompiler's NodeJS online editor helps you to write, compile, debug and run NodeJS code online
🌐
Codeanywhere
codeanywhere.com › languages › node-js
Node.js Online IDE, Compiler, Interpreter & Code Editor · AI Cloud IDE · Codeanywhere
Write and run Node.js code using our Python Cloud-Based IDE. You can code, learn, build, run, deploy and collaborate right from your browser!
🌐
Medium
hanwenzhang123.medium.com › javascript-behind-the-scene-fab2cda5c932
How JavaScript/Node Works Behind the Scene | by Hanwen Zhang | Medium
September 18, 2023 - How JavaScript/Node Works Behind the Scene A “high-level single-threaded, garbage-collected, interpreted (or just-in-time compiled), prototype-based, multi-paradigm, dynamic language with a …
🌐
NAMESPACE Blogs
blog.namespacecomm.in › building-a-custom-compiler-or-transpiler-with-nodejs
Building a Custom Compiler or Transpiler with Node.js
June 23, 2024 - A comprehensive guide on building a custom compiler or transpiler using Node.js, covering basics to advanced optimization techniques
🌐
Tutorialspoint
tutorialspoint.com › compilers › online-nodejs-compiler.htm
Online Node.js Compiler
Online Node Compiler - The best online Node compiler and editor which allows you to write Node Code, Compile and Execute it online from your browser itself. You can create Node Project using Node version Node v6.11.2. You can also Edit, Save, ...
🌐
Artoon Solutions
artoonsolutions.com › home › nodejs compiler essentials: everything you need to know
Exploring Nodejs Compiler: How it Transforms JavaScript Code
May 28, 2024 - When you run a Node.js application in Node compiler, it goes through a compilation process that involves several steps: The Node.js interpreter parses the JavaScript source code to create an Abstract Syntax Tree (AST).
🌐
DEV Community
dev.to › robiulhr › is-javascript-compiled-or-interpreted-language-l20
Is javascript compiled or interpreted language? - DEV Community
May 29, 2023 - Unlike a compiler, which translates the entire source code into machine code before execution, an interpreter reads and executes the source code line by line, translating and executing each statement as it is encountered.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › is-javascript-interpreted-or-compiled
Is JavaScript Interpreted or Compiled ? - GeeksforGeeks
June 9, 2024 - JavaScript is an interpreted language. To understand this better, let's look at interpreters, compilers, and JIT (Just-In-Time) compilers:
🌐
Medium
medium.com › @interviewer.live › understanding-the-node-js-interpreter-and-evaluating-ast-abstract-syntax-trees-6b46f743a6ca
Understanding the Node.js Interpreter and Evaluating AST (Abstract Syntax Trees) | by Interviewer Live | Medium
September 1, 2024 - What is the Node.js interpreter? The Node.js interpreter is responsible for executing JavaScript code and allows us to run our programs on the server-side. It’s built on the V8 JavaScript engine …