What is the difference between Rhino and Spidermonkey JavaScript engines?

帅比萌擦擦* 提交于 2019-12-03 05:11:41

问题


For the first time, I began learning Javascript, however on the start I stuck up with two possible options: Rhino and Spidermonkey. Could you please, tell me what is one, and what is another, so I can easily choose for myself the best option that suits my needs. If it makes easier for you, you can list advantages and disadvantages of both Javascript versions.


回答1:


It depends on what you're trying to do with JavaScript. If your intent is just to learn the language then I recommend using a web browser such as Chrome or Firefox and using their built-in (or addon) JavaScript consoles.

As to your specific question about standalone JavaScript interpreters, here are some notes:

  1. Rhino - implemented in Java, intended primarily for use as a scripting engine extension for the Java platform. Includes an interactive command-line console, which will be helpful for learning.
  2. SpiderMonkey - implemented in C/C++, intended for use as the JavaScript engine in Firefox.

See also:

  1. V8 - implemented in C++, designed primarily as the Chrome browser's JavaScript implementation; well suited for embedding.
  2. node.js - a standalone, evented, asynchronous JavaScript environment, based on V8.
  3. Narwhal - a CommonJS platform.
  4. Windows Script Host - includes a JScript interpreter (ECMAScript based, very similar to modern JavaScript).



回答2:


Rhino is written in Java. SpiderMonkey is written in C/C++. I wouldn't go near either for the purposes of "learning JavaScript", for which a browser is probably more suitable.



来源:https://stackoverflow.com/questions/8898557/what-is-the-difference-between-rhino-and-spidermonkey-javascript-engines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!