3 ms·
I mean if you didn't have something like LLVM you couldn't achieve anything in C so it's a bit of a nonsense question. But if you're asking the advantage of ta
by duped 3y ago
I mean if you didn't have something like LLVM you couldn't achieve anything in C so it's a bit of a nonsense question.
But if you're asking the advantage of targeting LLVM directly as opposed to targeting C then the answer is that you don't have to implement everything in terms of C's semantics, compilation model, and memory model. While you probably can the question is should you, and what that costs in terms of optimizations left on the table.
Some examples are the strict aliasing model, support for generators out of the box with blockaddr, guaranteed tail call optimization via specialized calling conventions, zero cost exception handling, and so on.
That's not even getting into some of the annoying stuff that you as a language author will probably care about at some point, like relying on glibc.