Faculty of Information Technology
Software Engineering Group

Frequently Asked Questions

Why do we implement our own JVM?

  • Why do we implements our own virtual machine?
    • industry-ready interoperability approach
    • enthusiasm and interest in virtual machine technology
    • research
    • fun :-)
  • Why did we choose Java?
    • according to tiobe Java is the most widely used OO language
    • existing libraries which could be reused in Smalltalk
    • interesting experiment - as far as we know, this is the only implementation of static language on top of dynamic environment

What is the difference to Java Connect?

Java Connect reuses standard JVM. Java objects live in the JVM, Smalltalk objects live in StVM, and a communication channel using some sort of FFI or RPC is estabilished between them. In STX:LIBJAVA, Smalltalk and Java objects live next to each other in a single VM.

We believe that the approach taken by STX:LIBJAVA, althrough demanding more engineering effort, pays out in the long run by having better possibilities and less limitations.

Does stx:libjava support Java security interface?

Java security interface, as many of the core Java classes, depends on a few native methods (which are implemented in C++ in OpenJDK). These methods must be reimplemented in STX:LIBJAVA, which is time consuming task for those methods are poorly documented. Right now, we have other native methods higher on the list, but the methods will be implemented one day. Of course, we welcome the help from the community.

Can one subclass a Java class from Smalltalk and the other way round?

Short answer is no.

Technically, there is no problem, no limitation from the VM and even now, you can create a Smalltalk subclass of a Java class. But there is no support in tools, no support in source code management, etc. We plan to support it, but it is not done yet.

The other way round, i.e., Java subclass of Smalltalk class may require some changes and trickery in Java compiler. We have some ideas how to do that and certainly we will experiment with it. Because of Java staticness and rather restrictive rules, it is trickier than Smalltalker might imagine.

What about performance?

Up to the point where the STX:LIBJAVA is right now, we were not focusing on the performance but rather on the features and complete implementation and interoperability issues for they are research-wise interesting.

Compared to Smalltalk code. Java looks to run much slower than Smalltalk, but that's mainly because of Java code including its runtime library is simply slow and bloated. Partially because of its design, partially because of limitations of the Java language. Practically, Java code inside Smalltalk/X VM runs as fast as Smalltalk or JavaScript or Ruby code.

Compared to Sun/Oracle JVM code. Althrough STX:LIBJAVA is usable, it cannot be compared to OpenJDK performance-wise. Its VM a result of many years of work of way more engineers and budget than we have. At the same time, our VM povides features (even for Java code!) than Sun/Oracle VM does not - for instance stack reification, class/method unloading, snapshot support etc.

If we get similar manpower as there was in Sun, we could make it as fast as JVM :-)

Is it possible to implement Java support for Pharo/VisualWorks/MyFavouriteSmalltalk?

Yes, there is no principial problem. However, the VM of YourFavouriteSmalltalk has to be modified.

Are you planning to port it to Pharo/VisualWorks/MyFavouriteSmalltalk?

No, unless there will be funding for such project. If so, we would love to do it. Sorry, our resources are very limited.

Does it support Swing/any other UI?

No. The only problem is to implement bunch of poorly documented native methods. Unless there will be a funding or our own need, it is unlikely that we will work on it. We use Smalltalk UI framework to build a UI. However, there is some support for AWT from Java 1.0 times - whether it works or not is not known, we didn't try it.

What are the plans for the future?

See the TODO. Drop us a note if you have an interesting idea what to do.

Last modified 4 years ago Last modified on Nov 24, 2013, 11:47:28 PM