Haskell on JVM?

HaskellJvmJvm LanguagesFrege

Haskell Problem Overview


I'm wondering if there is some way to make Haskell run on the JVM (compiled or interpreted)?

There exists JHaskell on Sourceforge but this one seems to be empty and dead.

GHC uses LLVM as compiler backend. Would it be a good idea or possible to compile LLVM to Java bytecode? Or maybe use a different compiler backend?

Haskell Solutions


Solution 1 - Haskell

You may want to investigate Frege. Quoting from that page:

> "Frege is a non-strict, pure functional programming language in the spirit of Haskell." > > "Frege programs are compiled to Java and run in a JVM."

Based on a brief perusal of the language specification, Frege looks to be nearly a Haskell clone. Perhaps the phrase "in the spirit of Haskell" is simpy intended to set the proper expectation.

Solution 2 - Haskell

Haskell works beautifully on the JVM. See Eta, a project that brings full GHC 7.10.3 Haskell onto the JVM with type-safe Java interop.

Solution 3 - Haskell

The only language I know that is close to haskell in the JVM is CAL. CAL is heavily based on haskell but it doesn't have all haskell's features. The type system is similar to Haskell 98, and syntactic sugar like do notation is missing.

Here's a comparison of Haskell and CAL: CAL for Haskell Programmers

The eclipse plugin is very polished and useful.

Note that CAL is part of the Open Quark framework.

Solution 4 - Haskell

There are big but surmountable impediments to GHC building to the JVM:

http://www.haskell.org/haskellwiki/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F

(Got a spare year or two to make it happen?)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjehaView Question on Stackoverflow
Solution 1 - HaskellDaniel PrattView Answer on Stackoverflow
Solution 2 - HaskellrahulmuttView Answer on Stackoverflow
Solution 3 - HaskellislonView Answer on Stackoverflow
Solution 4 - HaskellamindfvView Answer on Stackoverflow