SpiderMonkey vs JavaScriptCore vs?
-
23-08-2019 - |
Question
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.
Solution
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
OTHER TIPS
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]