8

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?

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
GrooveStomp
  • 374
  • 3
  • 18

1 Answers1

3

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.

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
nickname
  • 1,187
  • 1
  • 9
  • 20
  • I was using Martin York's response here: http://stackoverflow.com/questions/270455/is-it-possible-to-program-iphone-in-c for reference. I also think SnappyTouch (http://gamesfromwithin.com/) are using C++ as their iOS backend. Beyond that, thanks for the info! – GrooveStomp Jan 15 '11 at 19:14
  • I stand corrected. Apple merely requires Objective-C for the front-end. Also: 3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited). I will edit the response. – nickname Jan 15 '11 at 19:33