3 ms·
I don't doubt your position has merit, and there are many options for generating code other than llvm, but, is anything really quicker to implement than fprintf
by marktangotango 11y ago
I don't doubt your position has merit, and there are many options for generating code other than llvm, but, is anything really quicker to implement than fprintf? I have implemented compile (note I prefer to phrase it as 'source to source translation' rather 'compile') to X myself, and for a certain class of project (personal or rarely used by others, compilation speed isn't an issue) fprintf (or whatever) get's you a lot of bang for the development-hour buck.
- pcwalton 11y agoIn order to actually generate valid C, you have to do a lot of work to figure out what you're supposed to fprintf; you have to get the operator precedence right, you have to do scoping right, debugging the serialization code is annoying, etc. A high-level API like LLVM IR, by contrast, lets you interact with the IR as a tree instead of an output stream, which is usually easier because your AST is already a tree.
- sklogic 11y agoThere is a plain text form of an LLVM IR. It is a bit easier to pritnf it than a fully featured C.