Embedding javascript into an application (like Lua)

I do a lot of web-related work with Javascript (some mundane web app stuff, some bleeding-edge software renderer/WebGL stuff), and I also have game-related projects which I code mostly in C++.

I have intended for the C++ bits use Lua to accomplish dynamic scripting functionality, but I am starting to wonder if it may serve me well to somehow embed a Javascript engine into my codebase so as to minimize the amount of context-switching I do, because it is going to make me cringe if the time comes that I find myself needing to port Lua code to JS or port JS code to Lua.

The V8 Javascript engine is embeddable and everything for a desktop C++ application and that'd be the end of it but the monkey wrench in this situation here is the problem of never being able to get V8 for a submission to the iOS App Store.

This leads me down quite a different path. What I wonder now is whether it will be possible to use JavaScriptCore to basically replace what I would use Lua for.


正如对这个老问题的一个注意事项:Apple已经将JavaScriptCore作为IOS 7中的一个公共API,因此它可以用于动态脚本或其他应用程序逻辑。


Awesome! Somebody has already done this.

链接地址: http://www.djcxy.com/p/95458.html

上一篇: 使用LuaJIT编写脚本并选择性地对FFI进行沙箱处理

下一篇: 将JavaScript嵌入到应用程序中(如Lua)