Haskell-JNI Bridge

Antony Courtney antony@apocalypse.org
Thu, 05 Jul 2001 10:02:51 -0400


Hi,

Ashley Yakeley wrote:
> 
> Is Lambada (the Haskell-JNI bridge) gone? The web-page has disappeared.
> Using Java seems by far the most obvious way of getting all that
> GUI/network/SQL/whatever functionality, especially as the Java platform
> is almost ubiquitous (unlike .NET, Tk, X, GTK+, Win32 GDI, etc.).

I'll let Erik and Sigbjorn speak to the status of Lambada.  When I asked them
about this a few months ago, it was no longer under active development.  I have
heard mixed reports about its final status.

I, too, needed access to some Java libraries (specifically, the Java2D rendering
library) from Haskell, so I made my own system (based on GreenCard) that allows
Haskell to call Java code via the JNI.

While my system is somewhat limited in functionality (Haskell can call Java, but
not the other way around, because GreenCard doesn't seem to support that), the
system has been fairly robust thus far.  I have written interactive animations
in Haskell that are rendered using Java2D and displayed in a Java/Swing window.

My system includes a tool to do reflection on Java class files to generate
Haskell types and function bindings for Java methods (using the Lambada naming /
phantom type conventions), and registers all Java objects as "ForeignObj" values
in Haskell so that the Java objects are garbage collected when they are
unreachable.

I've tested my system under Hugs on Windows 2000, RedHat Linux, and Debian
Linux.

Please email me if you would like an early release 'snapshot' to play with.  We
are currently working on some enhancements to the reflection-based
binding-generator tool, and then we plan to make a more general release.

	-antony


-- 
Antony Courtney  
Grad. Student, Dept. of Computer Science, Yale University
antony@apocalypse.org          http://www.apocalypse.org/pub/u/antony