Squeak + Android and Dalvik!? (was Re: [Vm-dev] Performance, Quality and Process [was Array new: SmallInteger maxVal])

Göran Krampe goran at krampe.se
Fri Oct 23 10:04:33 UTC 2009

Hi Eliot and all!

Eliot Miranda wrote:
> The V1 JIT has been released to customers, and so is now our only VM, in use
> in the server and client components.  Performance is around 2.5x to 3x the
> old VM for real world use (number of clients that can connect to a server).
>  Certain macro benchmarks are in the 4x to 5x range.  We have been very busy
> and so the process of getting the VMs released has been put on the back
> burner.  I need to move them to the front of the stove :)

Sounds great! Yeah, we want it!!!! :)

>> There is no JIT. It is not fast. BUT... it is the VM on the Android and it
>> comes with tons of libraries etc.
>> Now... there is also an NDK (Native SDK) that allows one to compile C to
>> libraries (but not executables, not sure) that can in turn be used from
>> java/Dalvik... humm...
> But a JIT can live in a library.  Provided one can allocate executable
> memory (see my concluding question below).

Yes, AFAICT mono JIT works on Android.

Btw, this is a good set of introductory technical slides about the 
Android runtime env:


It explains Dalvik etc fairly good, from june this year.

This blog entry may be even more interesting:


>> So in order to be able to write anything remotely interesting for an
>> Android one needs to go "through" Dalvik somehow.
> The devil is in the details.  I'm pretty sure that Squeak would run horribly
> above Dalvik (sends, GC, tagged integers are all likely to suck on a VM not
> designed for Smalltalk).  But if Dalvik is not the entirte framework (you
> speak about libraries above) then running alongside is perhaps a
> possibility.  e.g. this is how David Simmons' S# runs within .net.

I did not mean "above" Dalvik as in "implemented on top of Dalvik". I 
was more toying with the idea of being able to "feed" Dalvik with DEX 
code from a Squeak VM running alongside it. Perhaps this is what you 
also describe above.

Thing is - we should not kid ourselves - the libraries on Android are 
java libraries (although converted to DEX form) and Android is getting 
pushed onto new CPUs "day by day". For example "The Droid" (Motorola's 
latest Android phone) uses a new CPU etc. So keeping up with the CPU 
level assembler is not something "we" would want to do.

So somehow standing on the shoulders of Dalvik could be an approach?

Dalvik will get some form of JIT soon most people seem to think.

> Is there no access other than through the VM?  One of the major pains with
> the iPhone is the lack of support for JITs.  The mmap function prevents
> granting execute access on the memory it allocates.  John McIntosh has
> suggested that Apple might be persuaded to provide a work-around for certain
> applications (i.e. the Cog JIT) but I think John is merely speculating
> optimistically (John, am I right or is there a real possibility here?).  It
> would be great if Android didn't present simular hurdles.

That sure does NOT seem to be a hurdle. And yes, there are plenty of 
access other than through Dalvik. I jsut don't think that you will be 
able to do much interesting without being able to reuse/use the java 

regards, Göran

PS. Remember that I brought this up a year from now when Android will be 
all over the place...

More information about the Vm-dev mailing list