4 ms·
> Does anyone know if there is a Haskell that targets the JVM? That could be a cool solution for me... While I'm far from an expert on the JVM, the primitive o
by silentbicycle 17y ago
> Does anyone know if there is a Haskell that targets the JVM? That could be a cool solution for me...
While I'm far from an expert on the JVM, the primitive operations that it provides are probably a poor fit for Haskell. One could compile Haskell to the JVM, but some Haskell elements such as thunks would probably have to be emulated (with lots of overhead), and/or it would have some arbitrary limitations (such as problems with tail-call optimization) due to the implementation.
There would be a similar mismatch compiling Haskell to the WAM/BAM (Prolog) or Lua virtual machines. Most VMs are designed to run a specific programming model, if not a specific language, and have bytecodes for core operations that need to be efficient (unification in Prolog, table lookup in Lua, dynamic dispatch in Java, etc.). While I could see another primarily procedural/OO language running on the JVM, Java and Haskell are like SQL and LaTeX: the elements they have in common are too general to be useful.