最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - SpiderMonkey vs JavaScriptCore vs? - Stack Overflow

programmeradmin3浏览0评论

I have a C++ desktop application (written in wxWidgets) and I want to add support for some scripting language.

Scripting would mostly be used for run-time conversions of strings, numbers and dates by user supplied JavaScript code.

I'd like to use JavaScript because it is widely used and everyone is familiar with the syntax.

Googling around, it seems I have two options:

  • SpiderMonkey from Mozilla
  • JavaScriptCore from WebKit

Has anyone tried those? Which one would be easier to set up? Do you know of some other implementation that is better for my needs?

BTW, I target Windows and Linux platforms.

I have a C++ desktop application (written in wxWidgets) and I want to add support for some scripting language.

Scripting would mostly be used for run-time conversions of strings, numbers and dates by user supplied JavaScript code.

I'd like to use JavaScript because it is widely used and everyone is familiar with the syntax.

Googling around, it seems I have two options:

  • SpiderMonkey from Mozilla
  • JavaScriptCore from WebKit

Has anyone tried those? Which one would be easier to set up? Do you know of some other implementation that is better for my needs?

BTW, I target Windows and Linux platforms.

Share Improve this question edited Aug 5, 2009 at 6:09 Milan Babuškov asked May 21, 2009 at 22:24 Milan BabuškovMilan Babuškov 61.1k49 gold badges130 silver badges180 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 13

There is also Google's V8 JavaScript engine, builds nicely on Linux, embedding API seems quite straightforward too: (Compared to SpiderMonkey's, never looked at the JavaScriptCore API) http://code.google.com/apis/v8/get_started.html

Of course, you could also use Lua, which not only is designed specifically for this, it's vastly faster than any JS.

Also, it's has well-designed semantics, a very minimal core, simple C API, great portability, a very mature JIT, the most helpful online community I've seen, etc...

JavaScriptCore has a stable C API (and ABI), and has been available (and used as) a standard system framework on macos.

[edit: oh, and it works on linux and windows as a standalone library, although i believe only debian distributes it as such]

发布评论

评论列表(0)

  1. 暂无评论