[gambit-list] Gambit for mobile?

Marc Feeley feeley at iro.umontreal.ca
Tue Feb 12 13:20:13 EST 2013


On 2013-02-12, at 1:11 PM, mikel evins <mevins at clozure.com> wrote:

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

I usually need to poke at the build settings to get things working, but I attribute this to the complexity of the IDE.  Gambit requires *no* external libraries (except for libc) and its code is compilable by C, C++ and Objective-C compilers without any fancy command-line options.  Some command-line options are suggested on some compilers to improve performance, but they are not required to build a basic system.

It would be interesting to know which build settings you had to use on Xcode.

Marc




More information about the Gambit-list mailing list