Re:Show HN: A compiler for a small language into x86-64 asse...
by Veera_Sivarajan on Friday May 01, 2020 @01:06AM
(#23039296)
What would be your advice to someone who's about to write a compiler? I'm planning to start by reading the Dragon book.
[ Parent
| on HN ]
Re:Show HN: A compiler for a small language into x86-64 asse...
by tonyedgecombe on Friday May 01, 2020 @01:14AM
(#23039326)
I never got on with the Dragon Book despite several attempts.
Re:Show HN: A compiler for a small language into x86-64 asse...
by abnercoimbre on Friday May 01, 2020 @02:59AM
(#23039692)
You both should try "Compiler Construction: Principles and Practice" [0]. Theory is interleaved with substantial examples and exercises. You create an entire compiler for a tiny language called TINY (hah.) You write it in C and generate code for a portable virtual machine -- the book also goes into detail on the VM, with source code.
Lastly, the book's appendix has guidance for writing a compiler for a subset of the C language.
Re:Show HN: A compiler for a small language into x86-64 asse...
by EllipticCurve on Friday May 01, 2020 @04:15AM
(#23040087)
I didn't really read any books on that topic. But did lots of general research about compiler stages. I also posted a few links some comments up, that helped a lot.
For for it! Start small and increase. But seeing a program in your own language output something makes it all worth it :)
Re:Show HN: A compiler for a small language into x86-64 asse...
by nils-m-holm on Friday May 01, 2020 @04:05AM
(#23040044)
http://t3x.org/t3x/index.html#t3x9
If you plan to buy the book, you will have to go to Lulu.com and search for it, as order links seem to be down after a site redesign.