问题描述
我需要将C ++类(打包为共享库)暴露给JavaScript的魔幻世界.
最明显的解决方案是使用Node.js/v8.问题是它必须在PowerPC上运行(请对此不做任何评论...)并且-las! -v8无法在PowerPC上运行( v8-powerpc 项目似乎已失效)./p>
我正在尝试了解是否还有其他可行的解决方案,目前存在一些可能性:
- emscripten ,它将LLVM位代码转换为JavaScript;
- WebKit的 JavaScriptCore ,尽管我不确定它是否可以工作(我将拥有WebKit还是在PowerPC上
我不是JavaScript专家,实际上我很失落,所以这是我的问题:
- 脚本是有效的解决方案吗? (您曾经使用过它吗?)
- 有人能指出我有关如何使用JavaScriptCore将C ++暴露给JavaScript的任何文档吗?
- 还有其他选择,和/或您采用哪一个?
非常感谢,
口语
Qt具有可在powerpc上运行的webkit端口,并且具有允许您调用C ++代码的JavaScript引擎.
I need to expose C++ classes (packed as shared libraries) to the magic world of JavaScript.
The most obvious solution is to use Node.js/v8. Problem is that it has to run on PowerPC (please no comments on this...) and - alas! - v8 doesn't run on PowerPC (the v8-powerpc project seems to be dead).
I'm trying to understand if there's any other viable solution, at the moment some possibilities are:
- emscripten, which converts LLVM bitcode into JavaScript;
- WebKit's JavaScriptCore, although I'm not sure it will work (I'll have WebKit on the PowerPC anyway)
I'm not a JavaScript expert and I actually feel quite lost, so these are my questions:
- Is emscripten a valid solution? (have you ever used it?)
- Can anyone point me to any documentation on how to expose C++ to JavaScript using JavaScriptCore?
- Is there any other option, and/or which one would you adopt?
Many thanks,
Rippel
Qt has a port of webkit that runs on powerpc and it has a javascript engine that allows you to call C++ code.
Qt: Making Applications Scriptable
这篇关于v8的替代方案,用于将C ++对象暴露给JavaScript(在PowerPC上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!