[gambit-list] Gambit and oximeter

Petersen, Chris CPetersen at cw.bc.ca
Wed Feb 23 10:06:28 EST 2011


As has been reported on the list, the stat64 patch is all 
that's needed to get gambit-c to build for iOS4. I don't
really have anything to add as far as Gambit build 
instructions go.

The framework used for the oximeter app exposes a small
OpenGL subset (~25 functions) through the Gambit FFI, and
uses a  native hook to transmit events (button/key
presses, motion, battery status etc.) to the scheme side.
The hook is a few hundred lines of code in whatever the
native language of the platform is. For example, the iOS
hook is ~400 lines of Objective-C, the Android hook is ~250
lines of Java with JNI callouts and so on. The OSX hook is
based on Carbon, while on linux and the *BSDs it's X11
based.  There is also a console variant of the hook that can
build apps without guis on any platform with a gcc compiler.
We need real-time audio for some of our applications, and 
this is done through an AudioUnit c-declare chunk for iOS
and portaudio FFI for everything else (except Android, still
haven't worked out how to do a real-time hook into the Java
audio API).  The rest of the framework is written entirely 
in scheme, including all application specific code, and a
widget based gui/event system on top of a GL/GLES
compatibility layer, also in scheme. 

The development environment is a standard make/autoconf
setup. For example, to build the oximeter (iPleth) for the
iPhone you'd do:

./configure --with-app=iPleth --with-platform=iphone
make

This invokes gsc+gcc to build the binary, signs it and
packages the app as needed for the particular platform.  The
framework is modular, and allows you to define any number of
apps. We are working on a handful of different ones at 
present. I do most development on a Mac, because I can then
compile an app for OSX, iOS, Android, Windows and linux from
the same box using just that single configure command.

By the way, I can report that gambit-c also works on Maemo,
Nokia's now abandoned smartphone OS (for the N900).  Early
versions of the framework ran on it.  Also have gambit-c
based applications running on embedded (Soekris) hardware 
with OpenBSD.

Chris

________________________________________
From: Álvaro Castro-Castilla [alvaro.castro.castilla at gmail.com]
Sent: Tuesday, February 22, 2011 10:23 AM
To: Raffael Cavallaro
Cc: Petersen, Chris; gambit-list at iro.umontreal.ca
Subject: Re: [gambit-list] Gambit and oximeter

2011/2/20 Raffael Cavallaro <raffaelcavallaro at mac.com>:
>
> On Feb 19, 2011, at 11:08 PM, Petersen, Chris wrote:
>
>> Yes, the phone oximeter is written in Gambit-C, with an
>> OpenGL based user interface and some minimal platform
>> specific glue
>
> Congratulations!
>
> I'm sure many people on the list would love to know your development set up - specifics of how you built gambit for iOS, what revision of iOS you used, any emacs customizations if you're using emacs with an inferior gsi/gsc for tethered debugging or incremental development, etc.
>
> Thanks in advance!
>
> warmest regards,
>
> Ralph

Yes! We are very interested in these topics! :)

Álvaro



More information about the Gambit-list mailing list