Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functional languages targeting the LLVM

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?

like image 780
Matthew Avatar asked Jun 10 '10 06:06

Matthew


People also ask

What languages support LLVM?

LLVM currently supports compiling of Ada, C, C++, D, Delphi, Fortran, Haskell, Julia, Objective-C, Rust, and Swift using various front ends. Widespread interest in LLVM has led to several efforts to develop new front ends for a variety of languages.

Does C++ use LLVM?

Two common language choices are C and C++. Many LLVM developers default to one of those two for several good reasons: LLVM itself is written in C++. LLVM's APIs are available in C and C++ incarnations.

What is the purpose of LLVM?

LLVM helps build new computer languages and improve existing languages. It automates many of the difficult and unpleasant tasks involved in language creation, such as porting the outputted code to multiple platforms and architectures.

Why is LLVM so popular?

What makes it so popular is that its modular design allows its functionality to be adapted and reused very easily.


1 Answers

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

like image 54
tzaman Avatar answered Sep 25 '22 04:09

tzaman