[gambit-list] Gambit for mobile?
mevins at clozure.com
Tue Feb 12 13:11:08 EST 2013
On Feb 12, 2013, at 12:04 PM, Marc Feeley wrote:
> On 2013-02-11, at 4:52 PM, Andrew Pennebaker <andrew.pennebaker at gmail.com> wrote:
>> What's the state of Gambit support for mobile app development?
>> Can we have tutorials for writing Android, iOS, and Windows Phone apps in Gambit?
> I don't know of any tutorial, but there are several existing project you could examine. For example, you could check how the "Gambit REPL" iOS app is implemented (in the contrib/ directory).
> There are also the scripts "misc/build-gambit-iOS" and "misc/build-gambit-android" which automate the process of building the Gambit runtime libraries on iOS and android (those scripts even download the latest sources automatically). Also, the file "misc/simple-make-project.tgz" is a useful starting point if you like make for automating the build process (but not specifically for iOS or android).
> But the gist of it is actually quite simple. Take all of the .c and .h files from the lib/ and include/ directories and compile them with the -D___LIBRARY and -D___PRIMAL flags. Then, compile you app.c and app_.c (generated using "gsc -link app.scm") and link all of the .o files together. The file "misc/vc2008.bat" is a shell script showing the steps (when using Microsoft Visual C++, but for other C compilers the process is simular). On iOS, android, etc you'll need to write some FFI interface to call out to the mobile device's libraries.
In practice, I've found it to be more complicated than this. You're completely right that the gist of it is just that simple, but there are lots of ways for things to go wrong. Each time I update the Gambit sources, or Apple's dev tools, or OSX itself, there's a risk that I'll have to spend time (sometimes a few hours) monkeying with C flags and LD flags in order to get things working again.
Maybe that's not true anymore; I wouldn't know at present, because it's been painful enough a few times that it's conditioned me to avoid updating things until I feel I really have to.
More information about the Gambit-list