News for hackers. Stuff that matters.
Re:Compiler Basics: LLVM by thisacctforreal on Tuesday March 12, 2019 @11:34PM (#19375472)
Is there any sense in compiling human-readable LLVM IR, like many compile-to-C languages aim to do?

I imagine doing so wouldn't have much value, as nobody programs in the IR.

Re:Compiler Basics: LLVM by civility on Tuesday March 12, 2019 @11:50PM (#19375560)
He's implementing his own language, so it seems it would be useful for debugging his own compiler. In other words, the IR he's generating is not really for anybody else, it's for himself.
Re:Compiler Basics: LLVM by chc4 on Wednesday March 13, 2019 @01:20AM (#19375952)
You can trivially dump your module to a file with the actual LLVM API using `LLVMPrintModuleToFile`, even if the module is in the middle of being built.

It's easier to emit human-readable LLVM IR if you're just playing around (or are using a language without good LLVM bindings), but it's strictly inferior to using the actual API

Re:Compiler Basics: LLVM by ben-schaaf on Tuesday March 12, 2019 @11:42PM (#19375516)
Its probably a little easier to reason about when you're toying around. The article does suggest using the API for any serious project.
Re:Compiler Basics: LLVM by pfdietz on Wednesday March 13, 2019 @08:09AM (#19377830)
It would be useful in testing the later stages of the compiler.