This book appears to be more of a "compiler-compiler design in C"; it goes through how to write a lexer and parser generator, then writes a compiler using them, and I think the resulting compiler is a bit of a letdown: it does not much more than translate C into a linearised subset of C, and so the IMHO more "interesting" and important parts of the back-end like register allocation and instruction selection are compl…
Compiler Design in C
41–46 of 46 posts
Re: Compiler Design in C
#42This book appears to be more of a "compiler-compiler design in C"; it goes through how to write a lexer and parser generator, then writes a compiler using them, and I think the resulting compiler is a bit of a letdown: it does not much more than translate C into a linearised subset of C, and so the IMHO more "interesting" and important parts of the back-end like register allocation and instruction selection are compl…
Care to expose any good book explaining more modern approach for compilers from the practical point of view (including RD)?
This explains the SubC compiler I mentioned in the original post.
Re: Compiler Design in C
#43Earlier quoted context omitted.
The good intro to compilers is Engineering a Compiler. It focuse more on optimization then most intro books, and its all SSA. If you want to go all in on SSA optimization, there is a book called Static Single Assignment Book and its written by a hole list of compiler writers. Its not finished but there is still a lot of information. You can find it here: http://ssabook.gforge.inria.fr/latest/book.pdf Or you can go wi…
Speaking of SSA and optimizations, I just remembered that Andy Wingo (core contributor to Guile scheme) has a treasure trove of great articles, e.g. a fun intro to SSA [1] or CPS as used in Guile [2]. His blog is totally worth just browsing around. [1] http://wingolog.org/archives/2011/07/12/static-single-assign... [2] http://wingolog.org/archives/2014/01/12/a-continuation-passi...
Re: Compiler Design in C
#44If you are interested in a printed version of a great beginner's compiler book, I can highly recommend Andrew W. Appel's "Modern Compiler in C". There are also versions of the book written for SML or Java. I have read and partially implemented the C version and I really enjoyed the book, basic enough to follow yet full-featured enough to be useful. The book starts with parsing (I prefer PEG or Pratt parsers for their…
Re: Compiler Design in C
#45This book appears to be more of a "compiler-compiler design in C"; it goes through how to write a lexer and parser generator, then writes a compiler using them, and I think the resulting compiler is a bit of a letdown: it does not much more than translate C into a linearised subset of C, and so the IMHO more "interesting" and important parts of the back-end like register allocation and instruction selection are compl…
And I agree for all its thoroughly-written tutorial approach, I don't find myself going back to it very often.
Re: Compiler Design in C
#46If you are interested in a printed version of a great beginner's compiler book, I can highly recommend Andrew W. Appel's "Modern Compiler in C". There are also versions of the book written for SML or Java. I have read and partially implemented the C version and I really enjoyed the book, basic enough to follow yet full-featured enough to be useful. The book starts with parsing (I prefer PEG or Pratt parsers for their…
Great book, though I recommend the SML version over C or Java for a clearer illustration of the concepts in code. Viewed side by side, the SML code looks concise and obvious vs. the long and wordy C/Java code. It just seems to lend itself better to the task, in that some of the pattern matching burden is already handled by SML.