Haskell Java Interoperability
Asked Answered
F

2

14

What are current solutions to Haskell/Java interop? I've seen the paper on Lambada by Meijer and Finne. There is a project called GCJNI, but it seems to be defunct -- links to it are broken. Is there something that one could use out of the box?

Frightened answered 10/3, 2012 at 21:5 Comment(2)
related: #2141648 #7961835 #4989098Salomo
Not exactly Haskell, but almost - code.google.com/p/frege - and it compiles to JavaChickenlivered
B
12

Using the GHC FFI you can create a shared library that exports functions from Haskell land, that Java can then use via JNA. Alternatively you can take this same shared library and write some glue code to expose it through JNI for a more "Java-y" interface. You could also go nuts and expose enough of JNI through the FFI to Haskell to really get your Java on (This is somewhat the approach the Lambada paper takes).

I believe the Haskell shared lib + JNA would be the simplest, easiest approach. This is assuming that it's easier to expose some Haskell functions to Java, than it is to expose some Java objects to Haskell. For some insight in going the other direction, you may be interested in Salsa, which is C#, not Java but the principles in designing the interfaces may be of interest.

Blanchard answered 10/3, 2012 at 21:57 Comment(1)
The really hard part is automating the generation of Haskell interfaces from Java code. Is there any progress on that?Frightened
N
1

Not really an interop, but you could use http rest or zeromq

http://www.zeromq.org/

haskell bindings: http://www.zeromq.org/bindings:haskell

Neidaneidhardt answered 11/3, 2012 at 7:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.