Sunday, March 29, 2009

PLT Scheme Meets The Android Platform

I just read a post from Grant Rettke that mentions Moby Scheme:

We are delighted to announce the first release of Moby Scheme, a compiler from Beginner Student Language (BSL) + World programs to smartphones. The current prototype compiles to the Android platform, and supports almost all BSL programs as well as libraries to accelerometer, GPS, and SMS functionality.

This apparently was the topic of the keynote at the most recent International Lisp Conference.

The World programming library allows for the creation of Simulations and Animations easily - check out this eBook for more information.

This is definitely a novel idea and can hopefully carve some time out to play around with it.

Scheme and Android geeks unite - oh wait, how big a population is that?

Update: I just got done viewing the keynote talk slides while listening to the audio. The setup took a bit of effort to get right, but it was definitely worth it. What an excellently delivered talk. Highly recommended.

Update: I couldn't resist at least making my own little hello-world application in Moby Scheme. So, here it is:

(require moby/stub/world)

(define WIDTH 320)
(define HEIGHT 480)

(define (render w)
   (text "Hello World" 10 "Black")
   (empty-scene WIDTH HEIGHT)))

(big-bang WIDTH HEIGHT 10 0)
(on-redraw render)

After a few minutes of poking around, I was able to compile this to Java and then run it on the Android Emulator:

Man, am I impressed. They sure have made programming for the Android platform fun and easy. Now I just need to think up an application to write...


  1. the beautiful part about Java is that there is a VM for almost every other language written in Java... I know they are working on Python, .NET, and Ruby too.

  2. Thanks for taking a look at Moby Scheme!

    I just made a commit so that Moby follows the presented language more closely; if you update from github, you'll want to adjust the last expression of your program to

    (big-bang WIDTH HEIGHT 10 0 (on-redraw render))

    Best of wishes!

  3. A quick response to Nick Carrasco's message. As my ILC talk says (but unfortunately, perhaps, takes some time to say it), we're not interested in merely porting "Scheme". That's not very interesting, nor even that appropriate for the platform. My talk explains in some detail why we're focusing on the World framework.

    Ben, thanks for the kind words. In terms of things you want to write, for inspiration, please take a look at the example programs that are provided in the distribution!