On Fri, Mar 04, 2011 at 10:29:05AM -0500, Dimitry Golubovsky wrote: > Hi, > > G??ran Krampe wrote: > > > ...or we need to get Squeak running inside/on-top-of Dalvik somehow. > > Weird ideas: > - PotatoSqueak is a port of the Squeak VM to java. Run that on Dalvik > and hey... > - PySqueak using Pypy could probably generate a fast Squeak VM running > in java bytecode which possibly also could be run on Dalvik. > > ------------------------------------------------------------------------------------------------------------------------- > > Well the original discussion on the Squeak ML declined into the OLPC > issues (back to Intel that is ;) > > Let's continue here. > > Thanks for the hints, I looked into these projects, but: > > Potato Squeak (JSqueak) doesn't seem alive. I tried to run it on my PC > with some recent Java (don't remember which version, same as I use to > compile Android stuff). Very slow, crashed all the time. Plus image > version is 2.x ... > > PySqueak seems like the repo is gone. Also, it's old too. > > Anyway, wrt translation of Squeak/Pharo VM to Java. How much labor > would it take to change VMMaker so it generates Java code instead of > C? Given some similarity between the two languages syntax?
I think this is a perfectly reasonable thing to consider. There is of course a C code generator already in place in VMMaker, and there is no reason that a Java code generator could not be written. Matched up with some support code written in Java, the result would in principle be a VM written entirely in Java with no clib calls, FFI, JNI, etc. I do not know what the resulting performance would be, and there is no good way to really know without trying it. But it might very well be good enough to produce a usable VM. My guess, based on absolutely no data whatsoever, is that such a VM might run perhaps 2 or 3 times slower than a standard interpreter VM. I note that the C VMs gain a lot of their performance through the C code inlining performed by the Slang translation (which is amazingly effective by the way). I don't know if similar optimizations would apply to a Java implementation, but it seems possible that a decent Java generator with inlining might produce acceptable results. > I need to move on with the native port because my endpoint is in a > concrete application rather than the port itself. But would anyone be > interested in adjusting VMMaker? If someone writes the Java code generator, then I would be happy to work on adjusting VMMaker to use it (and I'm sure others will help also). I'm not offering to write the code generator, but I think it would be great if someone wants to give it a try. Dave
