You also can't create JIT compiled REPL using C as easily.
You also can't create JIT compiled REPL using C as easily.
BTW this isn't a criticism of LLVM (far from it). It's expected to be used as a backend so any invalid IR is, pretty much by definition, a programmer error.
At the quick and dirty level, IMO C wins here as you can just splat the C you're building to a file and inspect it. With LLVM you need to get through the hurdle of building valid IR before you can serialise it.
In the longer term, I would argue that LLVM is better as you have way more control over what you're generating. Once your lowering works then the issue above is irrelevant.
LLVM does have a verifier pass which should catch every invalid IR. However, optimization passes aren't necessarily robust against weird types (I don't expect <13 x i3> to go over very well), and the backends are liable to flip out if the IR isn't in the subset they expect (e.g., weird types).
Instead of serializing it, directly write as text and process the file with the LLVM IR assembler.
Granted, it is still harder as just using C, but a step closer to LLVM and easier to debug.
I'm kind of surprised that there's not a library for emitting C code, though maybe my Google-fu is failing.
Essentially you generate a C-ast and then pretty print it. It has some limitations though.