Node.js是JavaScript运行时环境还是EcmaScript环境? [英] Is Node.js a JavaScript runtime environment or an EcmaScript environment?

查看:83
本文介绍了Node.js是JavaScript运行时环境还是EcmaScript环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 https://nodejs.org/en/


Node.js®是基于Chrome的V8 JavaScript引擎构建的JavaScript运行时。

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

但是,根据这个答案,JavaScript是:

However, according to this answer, JavaScript is:


JavaScript = ECMAScript + DOM API;

并且Node.js运行时中没有DOM。 (或者在那里?)同时引用本书:专业JavaScript for网络开发人员

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


虽然JavaScript和ECMAScript经常被同义使用,但
JavaScript不仅仅是在ECMA-262中定义。实际上,
a完整的JavaScript实现由以下三个
不同部分组成:

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:


  • 核心(ECMAScript)

  • 文档对象模型(DOM)

  • 浏览器对象模型(BOM)

支持我链接到的答案。

考虑到上述事实,不是正确的说Node.js是一个ECMAScript运行时?如果没有,如果我们想要分割Node.js并使其成为ECMAScript运行时而不是JavaScript运行时,我们需要删除(或添加?)?

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?

推荐答案

JavaScript和ECMAScript之间的差异只是一个迂腐的差异,大多数人并不真正关心。从技术上讲,根据标准的官方语言名称是ECMAScript,但出于历史和方便的原因,人们几乎总是称它为JavaScript。我从来没有见过任何自称为ECMAScript开发者的人。

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".

据我所知,JavaScript甚至没有正式的正式定义。虽然ECMAScript有一个规定性定义,其版本由各种规范正式定义,但JavaScript的含义基本上由人们如何使用它来定义。

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.

因此,Node.js将自己宣传为JavaScript运行时。将它称为ECMAScript运行时可能更技术上正确,但对于大多数人来说,以这种方式做广告会更加混乱。

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.

这篇关于Node.js是JavaScript运行时环境还是EcmaScript环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆