Re: [Pharo-project] Squeak/Pharo/Cuis on Android

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Squeak/Pharo/Cuis on Android

David T. Lewis
 
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

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Squeak/Pharo/Cuis on Android

Jecel Assumpcao Jr
 
David T. Lewis wrote on Fri, 4 Mar 2011 12:07:43 -0500
> 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.

Wasn't this what Dan Ingalls did at Sun before starting the Lively
Kernel?

-- Jecel

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Squeak/Pharo/Cuis on Android

Colin Putney-3
In reply to this post by David T. Lewis
 
On Fri, Mar 4, 2011 at 6:23 AM, Jecel Assumpcao Jr. <[hidden email]> wrote:

> Wasn't this what Dan Ingalls did at Sun before starting the Lively
> Kernel?

IIRC, it was a new Squeak VM written from-scratch in Java, rather than
generating Java from Slang.

Colin
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] Squeak/Pharo/Cuis on Android

David T. Lewis
 
On Fri, Mar 04, 2011 at 09:40:58AM -0800, Colin Putney wrote:

>  
> On Fri, Mar 4, 2011 at 6:23 AM, Jecel Assumpcao Jr. <[hidden email]> wrote:
>
> > Wasn't this what Dan Ingalls did at Sun before starting the Lively
> > Kernel?
>
> IIRC, it was a new Squeak VM written from-scratch in Java, rather than
> generating Java from Slang.
>
> Colin

Yes, that's right. There is some information here:
 http://news.squeak.org/2008/07/07/potato-version-of-jsqueak-from-hpi/

So I think that the idea of writing Slang code generators for
other languages remains unexplored territory. In particular,
the performance benefit of the Slang inliner are huge for the
C VMs, and if any similar optimizations were to prove effective
for Java, then the results might turn out better than expected.

Dave