5 ms·
Nice article and a good read! Just came in and read part 2, so please don't blame me if the following has been posted in a comment for part 1 already. IMHO the
by jsteemann 9y ago
Nice article and a good read!
Just came in and read part 2, so please don't blame me if the following has been posted in a comment for part 1 already.
IMHO there are plenty of good books on compiler construction. One of the best ones I ever got my hands on was a book by Niklaus Wirth (a now-retired professor, among other things, he created Pascal, Oberon and other languages). He explains all the details of creating your own compiler from the ground up.
It's available only here:
https://www.inf.ethz.ch/personal/wirth/CompilerConstruction/index.html https://www.inf.ethz.ch/personal/wirth/CompilerConstruction/...
In that book, he is creating a compiler for Oberon, a language that was more or less used for didactic purposes only.
The book is also pretty dated, so there is not much to take away in terms of practically usable compiler code. But I can still recommend it to everyone, because I think it's didactically very good, and provides all the necessary details that make compiler construction so worthwhile (and annoying).
- lboasso 9y agoI agree, Niklaus Wirth's compiler book is a good introduction to the topic. To showcase Wirth's approach, I wrote a self hosted Oberon compiler for the JVM: https://github.com/lboasso/oberonc https://github.com/lboasso/oberonc The compiler can also be used to compile and run the source code of Oberon0 provided in the book, all you need is a JVM installed.
- andrewbinstock 9y agoThat is very impressive. Congratulations!
- lboasso 9y agoThanks, my hope is that the Oberon language will not be forgotten. The Oberon0 language, described in the compiler book, is just a toy to illustrate basic compiler techniques. The full Oberon language is a simple but powerful language, that inspired Go.