Search code examples
androidiosscriptingschemeguile

Is it possible to embed Guile in a C++ app on iOS or Android?


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?


Solution

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