Smalltalk on Android

December 27, 2010

Yesterday, I took a brief look at the Android SDK. And I believe that porting the SST Smalltalk VM to Android should be very straightforward.

The first step is to create a Java version of the Smalltalk compiler, bytecode interpreter, and object support functions (these are now written in C#). Probably this could be ready about mid-January.

Next would be setting up the Android environment, which I am not at all familiar with. However, it seems to be mostly a lot of Java *.jar files. Also, I notice that they use *.el files for configuration which seem to be Emacs Lisp. In short, in looks like the Android SDK was created by good programmers.

Building the Smalltalk environment will then require using Java reflection to map Android primitives for creating graphical widgets and server communications – the same way that I now map Silverlight primitives.

And when these steps are accomplished, there should be a workable Smalltalk-80 environment running in Android.

It will require a bit of work, but I don’t see any “show stoppers”. I have already created a couple of Java-based Smalltalk interpreters, so all of this is familiar territory.

Android uses the Dalvik virtual machine which doesn’t allow for dynamic creation of Java bytecodes. This is similar to the limitations of the .Net CLR (which is why IronPython/IronRuby need the DLR extensions).

In contrast, my Smalltalk VM has a custom interpreter written in a host language (C# or Java) and uses Smalltalk-80 bytecodes. For small applications (like those in browsers or on mobile devices) the speed seems to be quite acceptable using this approach.

A Java version of the Smalltalk interpreter leads to several possibilities:

  • server-side Smalltalk functions
  • Smalltalk development environments for Macintosh and Linux (Swing or Android?)
  • Smalltalk apps portable across all Windows platforms (Win 7, Vista, XP)
  • Smalltalk apps portable across all major browsers (IE, Firefox, Safari, Opera, Chrome)
  • Smalltalk apps portable across phones and tablets using Android or Silverlight
  • (maybe) Smalltalk apps portable to Macintosh or Linux desketops

I have set up an Eclipse Java project to begin the port and I will report on the progress. Also, I have added a few more entries to the developer poll (see right of screen) to gauge the level of interest.

Advertisements

10 Responses to “Smalltalk on Android”

  1. Andy Burnett Says:

    Wow, that sounds amazing. It would be brilliant to be able to code up Android apps in Smalltalk.

    As a side note, have you looked at redline smalltalk? There may be ways you can collaborate.

    Cheers

  2. Peter Fisk Says:

    Andy,

    AFAICT, Redline Smalltalk wants to compile to Java bytecodes – which won’t work on Dalvik. Also, he talks about targeting other VM’s like LLVM and Parrot. – Way too complicated. Reminds me of David Simmons with SmallScript.

    My stuff works because I keep it as simple as possible.

  3. Andy Burnett Says:

    Simple is good 🙂


  4. Brilliant. I’m looking forward to updates on this! (I, too, would love to be able to develop Android apps in Smalltalk)

  5. Carl Gundel Says:

    Cool, but maybe it would be best to finish what you’ve started on Silverlight first before distracting yourself with Android?

    • Peter Fisk Says:

      I won’t be starting the Android port until a couple of weeks from now.

      The Silverlight VM has been quite stable for the last couple of weeks. There a still a number of bug fixes but they probably amount to a few days of work. Most of the extensions to the infrastructure will be done in Smalltalk and I expect that there will be many contributors to that.

      In any case, a Silverlight VM and an Android VM will share much of their Smalltalk libraries. So work on one is not necessarily detracting from work on the other.

  6. James Says:

    >>AFAICT, Redline Smalltalk wants to compile to Java bytecodes – which won’t work on Dalvik.
    This is true, but if you change Generator.java to output Dalvik you are on your way. Steve Baker was going to attempt this.
    Rgs, James.

  7. Michelle Says:

    I am looking for a tablet for my boys. I need the smalltalk app and wanted to know if any android run tablets have that. Their speech therapist uses an Ipad2 but that’s too expensive.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: