4 ms·
It does make sense, your language can target C or LLVM. each option comes with pros and cons e.g: C is more familiar, LLVM has better support for JIT compilatio
by latenightcoding 3y ago
It does make sense, your language can target C or LLVM. each option comes with pros and cons e.g: C is more familiar, LLVM has better support for JIT compilation.
- halayli 3y agoNo it doesn't. Ignoring the fact that you incorrectly refer to LLVM IR as LLVM, C is a language spec and LLVM IR is a dialect. LLVM IR dialect doesn't mean much outside LLVM framework and are constantly expanded upon and improved via no attributes and ops and abstractions to help trickle down context coming from levels above to be used for optimizations and making valid assumptions down the line. Comparing the 2 is nonsensical to say the least.
- twic 3y agoI know what you mean. But the fact is that there are compiler front-ends which produce LLVM IR, and there are compiler front-ends which produce C, so they alternatives to each other in that context.
- halayli 3y agoAnd what do you do with that produced C program?
- pizlonator 3y agoBoth C and llvm have been used as backends for other language implementations so it makes sense to compare them for that use case.
- latenightcoding 3y ago>> Ignoring the fact that you incorrectly refer to LLVM IR as LLVM I also "incorrectly" wrote "target C" instead of "target C code". It's obvious what I meant. >> Comparing the 2 is nonsensical to say the least. You could have easily googled "C vs LLVM as a backend" to find a lot of interesting discussions comparing both before being so confidently incorrect