C++ interop would make the whole issue moot since you wouldn't need most of the shim anymore: you'd only have to shim enough to interop with C++, then from that could call the LLVM API directly.
In the past when I've looked at LLVM from a distance, the biggest stumbling block I found were that it's written in C++ , which isn't the language I'm using for my frontend.
How important is the C++ API in practice? Are the bindings for other languages usable? Is it possible to have my frontend emit LLVM IR in a text format, similarly to how you can feed assembly language source code to an asssembler? Or should one really just bite the bullet and use C++ to generate the IR? I noticed that the compiler in this tutorial has a frontend in Ocaml and a backend in C++, with the communication between them being done via protobufs.
I did some searching to see people's experiences substituting other languages for C++ through LLVM, and didn't find much other than samples of translated calls.
Given that there would be a big benefit to this (not having to learn a new language, less manual memory management), are there good reasons this isn't way more common?
It's on the list of things that would be nice someday, but it will take a lot of time to get right, and it's not a high enough priority right now. There's a handful of other significant features that will come first, like ABI stability, Ceylon/Rust style ownership checking, first-class concurrency/atomics (async/await, etc.).
That said, Swift's C interop will work if you write an `extern "C"` interface to your C++. Obviously it's not ideal, but people have done projects like llvm-swift[0], with LLVM obviously being a C++ project.
Seems to me these are orthogonal concerns, LLVM is in C++ but the question I answered was about using LLVM versus implementing a custom toolchain, not implementing a custom toolchain in C++ versus some other language.
LLVM isn't really a JIT, and I've never heard of people using it as one for C++. (Also, those that tried to use it as a JIT had lots of problems, like Unladen Swallow).
reply