News for hackers. Stuff that matters.
Re:LLVM from a Go Perspective by vnorilo on Saturday May 04, 2019 @01:14AM (#19824600)
Hmm, not sure I agree that LLVM has little documentation. My experience using it has been pretty smooth.

Regardless, compiling functions from a language you know to LLVM IR is a good way to learn how IR works. You can do this for C(++) with the clang --emit-llvm switch. In addition, many optimizers in LLVM are geared towards the IR patterns clang emits.

Re:LLVM from a Go Perspective by krackers on Saturday May 04, 2019 @02:49AM (#19824874)
If you're working at the IR level, then there's usually pretty good documentation in terms of the doxygen and various pages explaining things.

But if you start venturing down into the backend, a lot of gotchas are never documented anywhere, just somehow learned through osmosis from another backend author or looking up code snippets from another implemented backend.

Re:LLVM from a Go Perspective by vnorilo on Saturday May 04, 2019 @03:06AM (#19824933)
Sure; the article was about building compilers rather than backends. FWIW I looked briefly into building a LLVM backend (IR subset) for a DSP chip, and gave up partly for the reasons you mentioned.
Re:LLVM from a Go Perspective by aykevl on Saturday May 04, 2019 @01:52PM (#19828014)
Yes, there is a fair bit of documentation. But it is nowhere near any popular general purposes language. Also, most documentation isn't very accessible if you're not a compiler developer already.

(Note: I'm the author of the post)

Re:LLVM from a Go Perspective by vnorilo on Saturday May 04, 2019 @02:08PM (#19828130)
If someone wants to get started on building a LLVM backed language, I’d recommend go with the Kaleidoscope tutorial [0] if one is new to compilers.

0: https://llvm.org/docs/tutorial/LangImpl01.html