Haskell running on top of Apache Spark
tweag.io
tweag.io
They first generate JVM bytecode from the Haskell source using their own code generator. This code is then shipped to the Spark cluster which executes the bytecode until it hits a static closure, the JVM will then call back into Haskell using a static pointer to execute the closure and will then continue with the bytecode.
The static pointer thing is what allows us to share (practically) arbitrary Haskell closures with Scala/Java. And more than that - to get Spark's Scala code to ship these Haskell closures between machines across a cluster.
So just for my understanding: the interop with the JVM works via JNI then?
The native code makes calls against the JNI and the Java bytecode calls back into the Haskell native code using the static pointers?