gpt4 book ai didi

javascript - SWIG 和 Javascript : does embedding the JVM/Rhino into my C++ app is still the only solution?

转载 作者:行者123 更新时间:2023-11-30 18:54:38 25 4
gpt4 key购买 nike

我真的很喜欢像 SWIG 那样自动生成绑定(bind)的想法。但它仍然缺少 Javascript 绑定(bind)。我读到它不能用 Spidermonkey 完成,因为必须将 JS 上下文作为参数传递给每个函数。

我找到的唯一解决方案是将 JVM 嵌入到我的 C++ 应用程序中,使用 SWIG 生成到 Java 的绑定(bind),然后使用 Rhino 引擎作为 JS 解释器。它工作正常,但它确实是重量级的!

还有其他想法吗?

注意:是的,我知道,我可以改用 Python 或 Lua。但我的问题实际上是关于 JS 的。

最佳答案

如果您不着急:WAITING Neha Narang 可能作为 GSoC-2012 项目“Javascript 新模块”开发的 SWIG Javascript 绑定(bind)。​​

abstract说:

This project aims to add Javascript as a new supported target language to swig to automate the generation of Javascript wrappers over C++.

项目存储库是 https://github.com/Neha03/gsoc2012-javascript .

关于javascript - SWIG 和 Javascript : does embedding the JVM/Rhino into my C++ app is still the only solution?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2563411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com