views:

528

answers:

1

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?

+18  A: 

There's a Haskell (GHC) backend targeting the LLVM; not "complete" yet but it seems fairly mature from reading through the docs.

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.)

tzaman