如果它是顾名思义的脚本语言,那么它必须用较低级别的语言编写,对吗?比如 PHP 是用 C 写的,JavaScript 是用什么语言写的?
最佳答案
Javascript 只是一个标准,更正式的名称是 ECMAScript .它可以用任何语言实现,就像任何标准一样。
Chrome 的 Javascript 引擎, V8 ,是用 C++ 编写的。
来自项目页面:
V8 is written in C++ and is used in Google Chrome, the open source browser from Google.
V8 implements ECMAScript as specified in ECMA-262, 5th edition, and runs on Windows (XP or newer), Mac OS X (10.5 or newer), and Linux systems that use IA-32, x64, or ARM processors.
Firefox 的 Javascript 引擎,SpiderMonkey (现在是 TraceMonkey)也是用 C++ 编写的。正如下面的 maerics 所说,Rhino是用 Java 编写的。
关于javascript - JavaScript 是用什么语言编写的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7005729/