by rkrzr · 10y ago · 0 comments
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.