<HTML>
<HEAD>
<TITLE>JNIPort preview for Squeak and Pharo available on SqueakSource</TITLE>
</HEAD>
<BODY>
<FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>I have made a preview release of JNIPort for Pharo/Squeak available on SqueakSource:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="#0000FF"><U><a href="http://www.squeaksource.com/JNIPort.html">http://www.squeaksource.com/JNIPort.html</a><BR>
</U></FONT><BR>
JNIPort is a Smalltalk library which allows Java code to be invoked from Smalltalk. It acts as a bridge between the world of Smalltalk objects and a Java Virtual Machine (JVM) where Java code is executing. <BR>
<BR>
If you want to know what can be done with JNIPort, see<BR>
&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR="#0000FF"><U><a href="http://philemonworks.wordpress.com/2010/04/29/google-api-access-from-smalltalk-using-jniport/">http://philemonworks.wordpress.com/2010/04/29/google-api-access-from-smalltalk-using-jniport/</a><BR>
</U></FONT>for an example.<BR>
<BR>
Installation instructions are on the Wiki at SqueakSource. See <FONT COLOR="#0000FF"><U><a href="http://jniport.wikispaces.com/">http://jniport.wikispaces.com/</a></U></FONT> for more information about JNIPort.<BR>
<BR>
The current state of the Pharo/Squeak version of JNIPort (as of June 8, 2010):<BR>
<BR>
</SPAN></FONT><UL><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Starting a JVM seems to lead to a deadlock in Squeak 4.1, but not in Pharo. When you start a JVM, nothing happens until you hit command-. (on a Mac), wait until a notifier for the user interrupt appears, and proceed. The problem seems to be somewhere in WeakRegistry; it disappears when you replace Squeak&#8217;s WeakRegistry by the WeakRegistry class from a Pharo image.
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>The UTF16TextConverter in Squeak 4.1 has a bug. I found the same problem in Pharo and reported it there, a patch is already in the queue for Pharo. I have no idea if this will automatically make it into Squeak. See <BR>
</SPAN></FONT></UL><BLOCKQUOTE><BLOCKQUOTE><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'><a href="http://code.google.com/p/pharo/issues/detail?id=2516">http://code.google.com/p/pharo/issues/detail?id=2516</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>This means that java.lang.String objects will probably result in junk when they are converted to Smalltalk Strings in Squeak 4.1.<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'><BR>
</SPAN></FONT><UL><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Callbacks from Java to Smalltalk are not yet supported. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>In contrast to VisualWorks and Dolphin, JNIPort does not create ghost classes as wrappers for Java classes, but creates &#8220;real&#8221; classes which can be seen in the system browser. It also does not copy prototypes of CompiledMethods when a wrapper class or a Java class is created, because this causes VM failures in Pharo 1.0. Instead, methods are compiled from source code. This has a performance impact, of course. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Another difference from the VisualWorks and Dolphin versions is that wrappers for Java methods without arguments don&#8217;t have selectors ending with an awkward &#8220;_null&#8221; suffix. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>JNIPort has been developed and tested with Pharo 1.0 on Mac OS X 10.6.3. If it works on other operating systems has yet to be tested. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>I don&#8217;t have a Metacello configuration yet.<BR>
</SPAN></FONT></UL><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'><BR>
The next steps will be:<BR>
</SPAN></FONT><UL><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Adding support for callbacks from Java to Smalltalk. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Testing it on more platforms. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Reorganization of the documentation on the JNIPort wiki, and addition of Pharo/Squeak specific documentation similar to the documentation for the VisualWorks version. 
</SPAN></FONT><LI><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'>Release of JNIPort 2.0 for VisualWorks and Pharo/Squeak when everything is stable. This will be after the release of Pharo 1.1.<BR>
</SPAN></FONT></UL><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'><BR>
If it works in Squeak 4.1 or on Linux or Windows, please let me know, especially if you had to do something which might be worth mentioning in the installation instructions.<BR>
<BR>
Have fun with JNIPort, and let me know if it works!<BR>
<BR>
Joachim Geidel<BR>
</SPAN></FONT>
</BODY>
</HTML>