[gambit-list] Building Gambit for iOS: weird bug (false alarm)

Marc Feeley feeley at iro.umontreal.ca
Mon Dec 27 09:07:16 EST 2010


On 2010-12-27, at 7:48 AM, mikel evins wrote:

> Aha; not so weird, after all. The Gambit built by Marc's script is built to run on the named target--in the case of the IPhoneSimulator version, it's intended to run on the IPhoneSimulator (duh!).
> 
> So what I needed to do was use the MacOSX version of Gambit to compile the Scheme sources against the IPhoneSimulator versions of the libraries, includes, and so forth.

Exactly.  This works because the Gambit-C compiler, when used in its fundamental Scheme-to-C mode, implements a transformation from Scheme to C which is independent of the host environment.  The C language is used as a universal target language.  You could run the Gambit-C compiler on Windows to produce C files for an iOS device, a Microblaze soft processor on a Xilinx FPGA, etc. or the other way around.  However, for the iPhone executable of the Gambit-C compiler, a major problem is that you have no read/write file system to store the result of the compilation.  It should be possible to circumvent this "problem" by linking with the compiler new versions of the open-input-file and open-output-file procedures so that they use the network to contact a file server of some sort (or use string ports).  You could maybe run TCC on the iPhone itself to have a completely self-hosted Gambit-C system...  Probably not very practical, but an amusing project anyway!  I wonder how this jives with Apple's license!

Marc




More information about the Gambit-list mailing list