Functional languages targeting the LLVM

Matthew picture Matthew · Jun 10, 2010 · Viewed 7.9k times · Source

Are there any languages that target the LLVM that:

  • Are statically typed
  • Use type inference
  • Are functional (i.e. lambda expressions, closures, list primitives, list comprehensions, etc.)
  • Have first class object-oriented features (inheritance, polymorphism, mixins, etc.)
  • Have a sophisticated type system (generics, covariance and contravariance, etc.)

Scala is all of these, but only targets the JVM. F# (and to some extent C#) is most if not all of these, but only targets .NET. What similar language targets the LLVM?

Answer

tzaman picture tzaman · Jun 10, 2010

There's a Haskell (GHC) backend targeting the LLVM.

You could also try using F# through Mono-LLVM.

Also, the VMKit project is implementing both the JVM and the .NET CLI on top of LLVM; it's still in its early stages but once it matures you could use it with F#, or any JVM-targeting functional languages (Scala, Clojure, etc.)