是否可以将 Guile 嵌入到 C++ 中? iOS 或 Android 上的应用程序?
Guile 看起来嵌入到 C/C++ 项目中有些简单,但它在 iOS 或 Android 上的表现如何?它是否需要那些平台不可用的第三方库?
与 JavaScript 或 Lua 相比,它作为一种嵌入式脚本语言有何不同?
Guile looks somewhat straightforward to embed into a C/C++ project, but how does it fare on iOS or Android? Does it require 3rd party libraries that are unavailable for those platforms?
How is it as an embeddable scripting language as opposed to JavaScript or Lua?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 iOS 上,C++(显然)适用于后端代码,但是,您需要 Objective-C 来进行 GUI/事件处理。 (已更正)。
另外,Android代码通常是Java。虽然您可以编写本机代码,但由于本机代码和 Android 上的 Dalvik 代码之间的通信开销,它通常会比较慢。
Guile 使用 GCC 构建,Apple 的 Xcode 包含 GCC 的变体,因此您可能会使其工作。然而,我会小心一些事情:
1)Apple 的 GCC 分支可能不包含构建现代版本的 Guile 所需的所有功能。
2) 虽然 Guile 本身是根据 LGPL(GNU 较宽通用公共许可证)获得许可的,因此可以在 iOS 应用程序中使用,但许多 Guile 库可能在 GPL 下,导致它们无法使用(出于法律原因,而不是技术原因) )。
我无法对此进行测试(无法访问 Mac),但是,Guile 至少应该在 Xcode 中构建。
至于Guile作为嵌入式脚本语言的性能,个人喜好优先。 Guile 是一个功能齐全的现代方案,但是,您必须考虑您的目标市场。如果他们可能拒绝Scheme,JavaScript(尤其是)可能是更好的选择。
On iOS, C++ (apparently) works for back-end code, however, you'll need Objective-C for the GUI/event handling. (Corrected).
In addition, Android code is usually Java. While you can write native-code, it is often slower because of the communication overhead between native code and Dalvik code on Android.
Guile builds with the GCC, and Apple's Xcode contains a variation of the GCC, so you might get it to work. However, I would be careful about a few things:
1) Apple's GCC fork may not contain all of the features necessary to build modern versions of Guile.
2) While Guile itself is licensed under the LGPL (GNU Lesser General Public License), and is therefore allowed to be used in iOS apps, many Guile libraries could be under the GPL, rendering them unusable (for legal, rather than technical, reasons).
I haven't been able to test this (don't have access to a Mac), however, Guile should at least build in Xcode.
As for Guile's performance as an embedded scripting language, personal preference takes precedence. Guile is a full-featured, modern Scheme, however, you must consider your target market. If they are likely to reject Scheme, JavaScript (especially) may be a better choice.