Language for LLVM Compiler

I am looking for some initial tests and experiments with a toy language and creating an LLVM compiler to get some comparable results.

I understand that C ++ is LLVM's β€œnative” and best-supported language, but I really don't want to use C or C ++. Therefore, I am looking for a higher level language that has stable and installed support for working with the LLVM API.

My initial work with the Python LLVM library was a little disappointing, as the project seemed to be abandoned, although I heard encouraging news about how PyPy integrates LLVM support within them, but I would like to know what people experience before drowning a lot time for any given route.

So my question is: did any of you have a positive experience working with LLVM using a higher level language and / or structure? And if so, which one? Or can you say you want to avoid?

+6
source share
1 answer

A subset of the LLVM API is open through simple C shells. This is sufficient for code generation and can be used in almost any high-level language. There are OCaml bindings out of the box (see this tutorial ), and Haskell bindings are pretty mature (for example, GHC itself can compile through LLVM). I also used LLVM in .NET languages, without any bindings (only P/Invoke tags automatically generated from headers).

+6
source

Source: https://habr.com/ru/post/900250/


All Articles