[Q][VM][ENH][RFH][COMP] Request For Help : CompilerPlugin

David Chase chase at world.std.com
Wed Apr 10 19:16:52 UTC 2002


At 12:22 PM 4/9/2002 +1200, Richard A. O'Keefe wrote:
>Karl Goiser <kgoiser at bigpond.net.au> wrote:
>        Speaking about compilers and the like, I was wondering if Squeak 
>        would benefit from being run on a Java VM?
>        
>No.  The JVM is very explicitly designed for a language which is
>not "Objects all the way down".  That is, it relies heavily on numbers
>_not_ being objects.  Lisp and Scheme people have noticed the same
>problem.

It's a little worse than not OATWD.  Clearly, most hardware
is not OATWD, nor is C, yet we manage to compile any number
of bizarre languages to C and/or hardware.  It's more a matter
of what the JVM won't let you do (just as C sometimes presents
problems as an IL because of what *it* won't let you do).

There's a basic mismatch between the Smalltalk typing/message
sending, and the Java (Virtual Machine) typing/message sending.
The VM itself is statically typed; either you will frequently
perform class/interface casts, or else the translator must take
the closure of the entire Smalltalk program and create a single
type for all Smalltalk objects, with a different method signature
for every Smalltalk message sent (i.e., your basic types-by-messages
table encoding).

The former (many interface casts) method is probably more flexible,
but the close-the-world-into-one-big-object approach will be
faster.

Either way, about the only thing you get from the VM is some notion
of portability; Smalltalk's use of the type system will look intensely
Martian to any Java programs out there (and vice-versa).

David Chase




More information about the Squeak-dev mailing list