I'm looking at doing some initial tests and experiments with a toy language and building an LLVM-based compiler to get some benchmarkable results.
I realize that C++ is LLVM's "native" and best-supported language, but I really don't want to use C or C++. So I'm looking for a higher-level language that has stable and established support for working with the LLVM API.
My initial work with the Python LLVM library was a bit of a disappointment as the project seems to have been abandoned, though I hear promising news about PyPy integrating LLVM support into their framework, but I'd like to know what people's experience is before sinking a lot of time into any given route.
So my question is, have any of you had a positive experience working with LLVM using a higher-level language and/or framework? And if so, which? Or are there any that you would say to avoid?
A subset of LLVM API is exposed via plain C wrappers. It is sufficient for code generation, and can be used from practically any high level language. There are OCaml bindings available out of the box (see this tutorial), and the Haskell bindings are quite mature as well (e.g., GHC itself can compile via LLVM). I've used LLVM from .NET-based languages too, without any bindings (just P/Invoke
wrappers auto-generated from the headers).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With