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.