News for hackers. Stuff that matters.
Re:A Complete Guide to LLVM for Programming Language Creators by tijsvd on Saturday December 26, 2020 @04:48AM (#25542412)
I've had success with the llvmlite Python binding. It has a Python-native utility to help build the intermediate code, and then it internally emits text and uses the llvm C api for codegen.

Both the text format and the C api are alledgedly more stable than the C++ api, so this may be a usable pattern in general. The text format is very well documented in my experience.

One downside to using text is an extra emit-and-parse-back step, but unless your code is huge, it's more than fast enough (and it falls away against optimization anyway).

There are no comments on this comment yet.