Porting Squeak to Java VM

Cees de Groot cg at cdegroot.com
Tue Nov 12 21:44:56 UTC 2002


Stephen Pair <spair at acm.org> said:
>Someone told me at OOPSLA that you can actually invoke the Java VM as a
>DLL on Windows (and I would assume that similar is possible on other
>platforms).  That might be less clumsy than a shell based interface.
>
The JVM *is* a DLL on most platforms - the 'java' command is just a wrapper,
just like e.g. VisualWorks. 

I still have some code lying around trying to invoke the JVM from VisualWorks.
It should work, as long as you stick to green threads - if you let the JVM run
loose in native threads mode, you are going to have a very hard time talking
to it wrt races etcetera. You still need to fire up the JVM in a second thread
(otherwise you'll loose control as soon as you call the thing), so you need to
be quite careful in letting the two VM's talk (maybe a third thread could run
a shared queue between the two?). 

Yes, it is possible. I think it's hard and only marginally useful -
there's lots of code in Java, but that's because Java requires lots of
code ;-). I doubt there are major Java packages you'd want to use from
Smalltalk without getting itchy to just rewrite the damn thing five
minutes after you've started using it...


-- 
Cees de Groot               http://www.cdegroot.com     <cg at cdegroot.com>
GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B
Cogito ergo evigilo



More information about the Squeak-dev mailing list