Live data from Hacker News

LLVM from a Go Perspective

aykevl.nl

11–15 of 15 posts

Re: LLVM from a Go Perspective

#12
post #2

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.

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

#13
post #12
post #2

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.

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)

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

Re: LLVM from a Go Perspective

#14
post #3

> compiler libraries such as LLVM make this a whole lot easier, making it possible for a single person to develop a new language that is close to C in terms of performance. The TinyGo project is interesting, but it is not a new language developed by a single person as Go is not a new language. Wondering is there any such single person project implementing a compiler for a new language using LLVM and delivering close…

Yes, Cone: http://cone.jondgoodwin.com/

Re: LLVM from a Go Perspective

#15
post #3

> compiler libraries such as LLVM make this a whole lot easier, making it possible for a single person to develop a new language that is close to C in terms of performance. The TinyGo project is interesting, but it is not a new language developed by a single person as Go is not a new language. Wondering is there any such single person project implementing a compiler for a new language using LLVM and delivering close…

Meet Wren: https://github.com/wren-lang/wren

Wren doesn't use LLVM nor claims C-like performance. It's a (fast) dynamic, interpreted language.
Post reply on HN