Node.js 就像 JavaScript 的 JVM 吗?

huangapple go评论142阅读模式
英文:

Can I say Nodejs is like JVM but for JavaScript?

问题

JAVA 在 JVM 中运行。
JavaScript 在 NodeJS 中运行。
所以,我可以说 NodeJS 就像 JVM,但是用于 JavaScript 吗?

英文:

JAVA runs in JVM.
JavaScript runs in NodeJS.
<br /><br />
Okay.

So, can I say that NodeJS is like JVM but for JavaScript ?

答案1

得分: 3

这不是这样的,NodeJS实际上是Google的V8引擎的实用包装器(实际上是一个必需品),是Google的JavaScript运行时的一部分。

此陈述还存在其他问题,因为Java编译为其自己的字节码(尽管您可以争论这是否是WASM或V8字节码),而JavaScript是解释执行的。

尽管存在这些差异,但从实际角度来看,NodeJS就像JavaScript的JRE。

英文:

It isn't, NodeJS is a utility wrapper (and really a necessary one) over the Google's V8 engine, Googles JavaScript runtime.

There are also other issues with this statement as Java is compiled to its own byte code (although you could argue that this would be WASM or V8 byte code) and JavaScript is interpreted.

> Despite these differences, NodeJS is like JRE for JS in a practical sense

huangapple
  • 本文由 发表于 2020年8月5日 10:15:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63257479.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定