[Haskell-cafe] Instead of Haskell running on the JVM is there a way for Haskell to call a JVM language ...

Bernhard Urban lewurm at gmail.com
Tue Nov 20 23:50:28 CET 2012

On Tue, Nov 20, 2012 at 11:01 AM, Ilya Portnov <portnov at iportnov.ru> wrote:
> Please take a look at http://hackage.haskell.org/package/hs-java also. It's
> an assembler/disassembler of Java bytecode and *.class files. Moreover,
> there is https://github.com/MateVM/MateVM — an (experimental) Java VM on
> Haskell :) So, if you are interested in haskell/java interop, maybe we could
> integrate our efforts.

To elaborate the current state of MateVM a bit:
We implement methods declared as native in Java by either IO Haskell
functions or C functions. You can hook a Haskell function here in the
source [1]. There're already some examples.
Drawbacks are:
(1) you have to mess around with the internal object layout if you
want to pass values, which is JVM specific
(2) it is *not* the standard way, i.e. it isn't like in JNI defined
(3) we'll probably change the interface sooner or later ;)

If you want to play around, you're welcome. But if you need something
stable, don't use MateVM at the moment :-) it's like two man-years
away from something productive usable.


[1] https://github.com/MateVM/MateVM/blob/master/Compiler/Mate/Runtime/MethodPool.hs#L62

More information about the Haskell-Cafe mailing list