SpiderMonkey vs JavaScriptCore vs?

发布于 2024-07-20 05:55:35 字数 361 浏览 7 评论 0原文

我有一个 C++ 桌面应用程序(用 wxWidgets 编写),我想添加对某些脚本语言的支持。

脚本主要用于由用户提供的 JavaScript 代码进行字符串、数字和日期的运行时转换。

我想使用 JavaScript,因为它被广泛使用并且每个人都熟悉其语法。

谷歌搜索了一下,似乎我有两个选择:

  • 来自 Mozilla 的 SpiderMonkey
  • 来自 WebKit 的 JavaScriptCore

有人尝试过这些吗? 哪一个更容易设置? 您知道其他更适合我的需求的实现吗?

顺便说一句,我的目标是 Windows 和 Linux 平台。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱给你人给你 2024-07-27 05:55:35

还有 Google 的 V8 JavaScript 引擎,在 Linux 上构建得很好,嵌入 API 看起来也相当简单:(与 SpiderMonkey 相比,从未看过 JavaScriptCore API)
http://code.google.com/apis/v8/get_started.html

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

忘羡 2024-07-27 05:55:35

当然,你也可以使用 Lua,它不仅是专门为此设计的,而且比任何 JS 都要快得多。

此外,它还具有精心设计的语义、非常小的核心、简单的 C API、出色的可移植性、非常成熟的 JIT,我见过的最有帮助的在线社区等等......

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...

失退 2024-07-27 05:55:35

JavaScriptCore 具有稳定的 C API(和 ABI),并且已在 macOS 上可用(并用作)标准系统框架。

[编辑:哦,它作为一个独立的库在 Linux 和 Windows 上运行,尽管我相信只有 debian 才这样分发]

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]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文