Thursday, August 04, 2011

Smalltalk on JVM

Found Smalltalk mentioned in a Java 7 presentation from Oracle citing Mark Roos from Roos Instruments, Inc:

"“We were able to implement all of the Smalltalk constructs... using invokedynamic to execute Smalltalk code on the JVM. ...The ease of putting a true dynamic language on the JVM was a wonder in itself.”

Note that with JSR292 there is more support for dynamic languages on JVM.
Found a presentation about the "RTalk" project to run Smalltalk on JVM and there is work going on as this message from the open jdk mailinglist proves.

Even when it runs on JVM - I still expect it to be limited compared to a Smalltalk running on a Smalltalk VM. The future will show if I'm right.


haupz said...

It's a limited Smalltalk in itself, built to fit the purpose of the company it was developed in. Don't expect this to be anything like Squeak, VW or Smalltalk/X. IIRC, the interface to an instance of this Smalltalk is a browser. No, not the Smalltalk browser. A web browser. :-)

Dave Newton said...

Why would running on the JVM be inherently limiting?

Torsten said...

There is much stuff that one can do on a JVM now (even on-the-fly dynamic compilation).

But if you have a Smalltalk that is running on a Smalltalk VM you can do anything that is possible in ST - without any compromise.
You have complete control on garbage collection, compiler, ...
and it is mostly "Smalltalk all the way down".

But on (security) restricted VM's like Java or the CLR (from .NET) you loose this control and will therefore be limited in one or the other way.

Think of the #allInstances method for example. This allows you to get a list of all instances of a class in Smalltalk. Would not be possible since this would mean to break security boundaries on JVM/CLR since you would be able to manipulate any instance in the system.

It is also possible that you get more power than originally intended since you can do more tricky things in dynamic languages like Smalltalk (change language on the fly, ...).

David Simmons for instance was able to subclass even sealed C#/VB.NET classes on the CLR with his S#/Smallscript (a smalltalk for .NET).

There is also the issue of performance - the bytecodeset of the JVM is designed and optimized for Java and not for Smalltalk.

Michael said...

Hi, check out Redline Smalltalk