←back to thread

429 points rui314 | 2 comments | | HN request time: 0.001s | source
Show context
peterkelly ◴[] No.10732090[source]
For anyone interested in compiler writing and looking for a good resource to start, probably one of the best is the "Dragon Book":

http://www.amazon.com/Compilers-Principles-Techniques-Tools-...

I highly recommend it, but it's heavy stuff. There are probably simpler guides out there that just cover the basics.

replies(6): >>10732136 #>>10732162 #>>10732256 #>>10732890 #>>10733017 #>>10742248 #
sklogic ◴[] No.10732162[source]
Please stop recommending the Dragon Book already. It is not just heavy, it is mostly outdated and irrelevant.
replies(7): >>10732214 #>>10732311 #>>10732417 #>>10732559 #>>10732828 #>>10733072 #>>10733258 #
nickpsecurity ◴[] No.10732559[source]
There's quite a few decent alternatives. I often suggest Wirth's Compiler Construction and Oberon sources because they're straightforward lessons plus give experience with Wirth style of simple, safe, efficient languages. Then, they can improve the Oberon System or compilers for personal projects and improvement.

That said, I typically recommend compilers get written in an ML or LISP given it's so much easier to do in those languages. Ocaml and Racket are my main recommendations for modern work. One can also use techniques for deriving imperative code from functional programs if one wants to re-implement that compiler in specific imperative language on a machine. The constructs are even straight-forward enough for macro assembly for those that want to understand it down to bare metal.

replies(2): >>10732949 #>>10733059 #
1. sklogic ◴[] No.10732949[source]
Yes, functional side of things is interesting and rarely covered in the standard compilers courses.

There is an old but good book, often overlooked: "Functional Programming" by Anthony J. Field and Peter G. Harrison (1988). Despite the title, it's more about various compilation techniques.

Also an old but still relevant (it is missing the STG, but otherwise full of interesting stuff): http://research.microsoft.com/en-us/um/people/simonpj/papers...

It also worth following this blog: https://wingolog.org/

replies(1): >>10733264 #
2. nickpsecurity ◴[] No.10733264[source]
I got the 2nd link here before, maybe from you. Might be old but very thorough treatment of about every aspect of functional compilation. I have it saved in djvu and pdf in case I neet someone starting in that area. :)

The other two are new to me. Thanks for those.