An introduction to LLVM in Go
blog.felixangell.com
An introduction to LLVM in Go
1–10 of 13 posts
Re: An introduction to LLVM in Go
#2Re: An introduction to LLVM in Go
#3This little tutorial is so perfectly written. It makes no assumptions about what you know besides basic computer science and guides you through getting going with LLVM. I love it, makes it look so simple.
Re: An introduction to LLVM in Go
#4Re: An introduction to LLVM in Go
#5This little tutorial is so perfectly written. It makes no assumptions about what you know besides basic computer science and guides you through getting going with LLVM. I love it, makes it look so simple.
Re: An introduction to LLVM in Go
#6Re: An introduction to LLVM in Go
#7As a web developer, LLVM has always been a mystery to me. I have a basic understanding of computer science, but that has never been enough to parse through the documentation, written for those more used to lower level development. This is a wonderful article for absolute beginners, showing quite literally what LLVM does and how to use it.
https://gist.github.com/piroux/a856aa31525ca23238be
It can directly run with lli:
$ lli basics_array.ll
Note: I called it DynArray because I wanted it to grow itself when its nominal capacity would have been reached, but I never took the time to implement this feature ...
For instance, the prototype of the function adding an element could be :
define void @DynArrayI__add(%DynArrayI* %dynarray, i64 %elt)
You might need to add a capacity field to the type of DynArrayI and update others functions, to take it into account.
But according to me it is doable, even for a beginner, because the code is entirely written in LLVM.
So feel free to try !
Re: An introduction to LLVM in Go
#8This little tutorial is so perfectly written. It makes no assumptions about what you know besides basic computer science and guides you through getting going with LLVM. I love it, makes it look so simple.
Agree completely, this is a really well-written and informative article. Even more impressive is when you scroll to the bottom and notice this was written by a "17 year old student from Brighton who programs for a hobby."
Re: An introduction to LLVM in Go
#9As a web developer, LLVM has always been a mystery to me. I have a basic understanding of computer science, but that has never been enough to parse through the documentation, written for those more used to lower level development. This is a wonderful article for absolute beginners, showing quite literally what LLVM does and how to use it.
I would suggest sticking to a simple language, rather than trying to build a C compiler or something. The principles are what you really ought to learn, and those are the same. Even just writing a brainfuck interpreter is a good exercise if you don't know how to do it. (Despite the profane name and its implication that it ought to be something very complicated, brainfuck is actually very simple. Some people use "write a brainfuck interpreter" as their test project whenever they pick up a new language.)
Compilers and interpreters are one of the things that make the difference between a "code monkey" and a "software engineer", and even in web development they can be incredibly useful.
Re: An introduction to LLVM in Go
#10As a web developer, LLVM has always been a mystery to me. I have a basic understanding of computer science, but that has never been enough to parse through the documentation, written for those more used to lower level development. This is a wonderful article for absolute beginners, showing quite literally what LLVM does and how to use it.
Rather than learning LLVM per se, I'd recommend running through any of the many fine "build a compiler" tutorials out there on the internet. A google search on "build a compiler" pulls up a lot of interesting resources. I would suggest sticking to a simple language, rather than trying to build a C compiler or something. The principles are what you really ought to learn, and those are the same. Even just writing a bra…
Writing a Brainfuck interpreter is a good idea! (I'm aware of the language.) Perhaps I could also try ArnoldC. :3
Recently, I began working with HHVM, I've been very interested in the subject of compilers and interpreters. I would certainly love to build such a thing for JS one day.