3 ms·
Can someone explain the advantage of compiling to C instead of compiling to LLVM-IR? I have seen more languages that compile to C than to LLVMIR. It seems to me
by efferifick 11y ago
Can someone explain the advantage of compiling to C instead of compiling to LLVM-IR? I have seen more languages that compile to C than to LLVMIR. It seems to me that there are a lot of advantages in using LLVM but I fail to see the advantages of compiling to C.
Thanks
- andrewchambers 11y agoCompiling to llvm brings a giant complicated build time dependency and it is not pleasant to emit it as plain text due to some strange design decisions. People are also more familar with C, it works on more platforms, and doesn't require any familiarity with SSA. I think you only really need llvm when you want to get into debug symbols.
- srean 11y agoAs a targets both C and LLVM-IR are quite popular, but I really wish there was a mature target that enabled efficient coroutines cleanly and _portably_. C exposed pretty much every low level extraction of the underlying machine model but left out stack switching, which the PDPs were very capable of.