8

According to https://nodejs.org/en/

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

However, according to this answer, JavaScript is:

JavaScript = ECMAScript + DOM API;

and there is no DOM in Node.js runtime. (or is there?) Also quoting from the book: Professional JavaScript for Web Developers:

Though JavaScript and ECMAScript are often used synonymously, JavaScript is much more than just what is defined in ECMA-262. Indeed, a complete JavaScript implementation is made up of the following three distinct parts:

  • The Core (ECMAScript)
  • The Document Object Model (DOM)
  • The Browser Object Model (BOM)

which supports the answer I link to.

Considering the facts above, isn 't it correct to say Node.js is a ECMAScript runtime? If not, what do we need to remove (or add?) if we wanted to fork Node.js and make it an ECMAScript runtime instead of a JavaScript runtime?

Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
  • It looks like this comment from the linked answer is related: "Node.js is built against modern versions of V8." & "V8 implements ECMAScript as specified in ECMA-262, 5th edition..." & "The DOM is not, however, typically provided by the JavaScript engine but instead by a browser. The same is true of V8—Google Chrome provides the DOM." - so it looks like the DOM is in V8 then and Node's site is correct in saying that it's a JS runtime? – pushkin May 11 '18 at 16:28
  • No offense, but does this matter? Aren't we being a little pedantic with sematics? Lots of things that aren't precisely synonymous are used interchangeably in casual conversation. As for forking, to what purpose? – Jared Smith May 11 '18 at 16:29
  • 1
    "what do we need to remove (or add?) if we wanted to fork Node.js and make it an ECMAScript runtime instead of a JavaScript runtime?" What are you trying to do exactly? Or what are you doing this for? Is this purely theoretical? – pushkin May 11 '18 at 16:30
  • @JaredSmith I do not agree official documentation is casual conversation. – Koray Tugay May 11 '18 at 16:35
  • 1
    Have you considered that the answer you cited as a "fact" could simply be wrong? – Bergi May 11 '18 at 16:36
  • @Bergi Yes, that is why I also provided a second reference.. – Koray Tugay May 11 '18 at 16:38
  • @KorayTugay ok fine: change casual conversation to "usage outside of legal documents or in the context of a formal specification", does my point not hold? – Jared Smith May 11 '18 at 16:56
  • @JaredSmith Thank you for your valuable input. To me it does make a difference. Not the biggest difference in the world, but makes a difference big enough that leads me posting a question. – Koray Tugay May 11 '18 at 17:01

2 Answers2

9

The difference between JavaScript and ECMAScript is just a pedantic difference that most people don't really care about. Technically the official language name according to the standard is ECMAScript, but for historical and convenience reasons people almost always call it "JavaScript". I've never met anybody who calls themselves an "ECMAScript developer".

As far as I know, JavaScript doesn't even have an official formal definition. While ECMAScript has a prescriptive definition with versions that are formally defined by their various specifications, the meaning of "JavaScript" is essentially defined by how people use it.

For this reason, Node.js advertises itself as a JavaScript runtime. It might be more "technically correct" to call it an ECMAScript runtime, but it would be more confusing for most people to advertise it that way.

Peter Olson
  • 139,199
  • 49
  • 202
  • 242
  • 1
    I think _Oracle_ may disagree with you that it is a _"pedantic difference"_. Though they've never taken legal action, ECMAScript was contrived because JavaScript is a trademark currently owned by _Oracle_ (formerly _Sun Microsystems_ formerly _Netscape_). See [this thread](https://softwareengineering.stackexchange.com/questions/135905/legal-ramifications-of-use-of-the-javascript-trademark) for more details... – War10ck May 11 '18 at 16:40
  • 3
    @War10ck That's true, organizations that create new technologies avoid naming them "JavaScript" for legal reasons, but it's still a detail that won't matter in most situations. – Peter Olson May 11 '18 at 16:51
  • "JavaScript" is essentially defined by how people use it." Nope. It's defined by how the compiler works. For node, js is what node can actually compile. It doesn't matter "how people use it". – Juan Perez Jun 27 '23 at 03:57
  • @JuanPerez I think you misunderstood the point. I was talking about the usage of the word "JavaScript", not about the behavior of code. You're right that how code executes is determined by the compiler, but I was talking about what people mean when they use the word "JavaScript". – Peter Olson Jun 27 '23 at 15:38
-2

There are many JavaScript run time environment:

  1. Browsers
  2. Node.js
  3. Deno
  4. Edge Workers
  5. Moddable
  6. Databses
  7. Productivity Software

source: https://www.youtube.com/watch?v=JN7UjvceOlw