[racket] compiling Racket to android and ios apps

From: Darren Cruse (darren.cruse at gmail.com)
Date: Sat Feb 21 13:19:03 EST 2015

I could chime in I've also been interesting in Racket for mobile apps.
Though I've just been learning Racket (and scheme) the last few months take
what I say with a grain of salt...

Re-reading the OP's post it sounds like you've actually done Racket based
Phonegap/Cordova apps...  I was going to mention Moby and/or Whalesong but
it sounds like been there/done that?

Otherwise I too had briefly looked at Lamdbanative as mentioned above.

That was interesting to me as a newbie to Racket and scheme both in seeing
how much of my Racket learning helped me to follow their code, as well as
how much does not.  :) i.e. I'm new enough I'm not always appreciating what
in Racket is standardized and what is not...

Glancing at this example game Lamdbanative includes:
https://github.com/part-cw/lambdanative/blob/master/apps/uSquish/main.scm

My first reaction was "great I can read this code!" then my second reaction
was "oh yeah that's right big-bang ain't gonna be here...  hmmm I don't see
require anywhere I guess modules work differently too ok..."

Which is not to be negative it was just to recognize that gambit scheme and
lambdanative isn't racket so seemingly wouldn't be able to benefit from a
lot of Racket modules or it's community etc...

Otherwise did you notice Lambdanative has it's own widget set built atop
OpenGL - that's how it achieved portability across iOS and Android with the
same code. But of course those widgets are a tradeoff - depending on what
you're doing (e.g. a game) they may be fine, but if you really want the
look and feel of native widgets that's not what you're getting.

Lastly (maybe you know this) Gambit by design is a scheme to C translator
apparently that's why it was chosen for doing these mobile apps i.e. the
resulting code is comparable size wise and performance wise to something
you might have written in C, and obviously C is portable across iOS and
Android.

I don't really know but I'm guessing porting the Racket VM to operate well
on iOS and Android is a bigger job than this (i.e. than getting Gambit's C
code to compile on IOS and Android).  i.e. Maybe that's why there's not a
better Racket on iOS/Android story already. :)

Chicken scheme uses a similar compile-to-C approach (they call it "Cheney
on the MTA" you can google it if you're interested).  They seem to have a
good community too with lots of these packages (they call "eggs").  And I
know there's at least this one effort to do android native apps with
Chicken:  https://github.com/chicken-mobile/android-chicken

But in the end I didn't find any perfect answer either.

I came away wishing that somehow Gambit/Lambdanative could be enhanced to
be Racket compatible...  if only I had a magic wand. :)







On Sat, Feb 21, 2015 at 4:06 AM, Stephen De Gabrielle <
spdegabrielle at gmail.com> wrote:

> FWIW this project targets both android and IOS:
> https://github.com/part-cw/lambdanative
>
> On Fri, 20 Feb 2015 at 19:32, Jens Axel Søgaard <jensaxel at soegaard.net>
> wrote:
>
>> 2015-02-13 23:08 GMT+01:00 Neil Van Dyke <neil at neilvandyke.org>:
>> > Anyone have any current/planned projects on compiling Android and iOS
>> apps
>> > from Racket?
>>
>> > So, as an alternative for smartphone/tablet apps, to keep handy as a
>> backup
>> > to HTML5, I'm interested again in the idea of compiling Racket to
>> native iOS
>> > and Android apps.  Typical polished commercial-grade apps, so pedagogic
>> > graphics worlds alone usually aren't enough.
>>
>> I'd be interested in helping with iOS apps (writing bindings etc)
>> provided someone
>> solves the initial hurdle: getting Racket to cross compile to iOS and get
>> it
>> running on an emulator (and later an actual phone/tablet).
>>
>> There might be some hints (wrt compiler switches) here:
>>
>>     https://github.com/feeley/gambit/blob/master/misc/build-gambit-iOS
>>
>> /Jens Axel
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150221/177da35f/attachment.html>

Posted on the users mailing list.