People ask "how do I learn compilers" in some form or other every few weeks. Someone immediately replies "read the dragon book". This is very bad advice for a compiler newbie (see discussion)
If you find yourself in this position, please recommend "Engineering a Compiler" by Keith Cooper/Linda Torczon, or "Modern Compiler Implementation in X" (where X should probably be Java, maybe C), by Andrew Appel. These are excellent introductions to compiler for beginners.
Please also vote down answers where the answerer says only "read the Dragon Book", without a qualifying remark.
The Dragon Book is a very thorough book, with detailed discussion of theory (especially about parsing). However, this level of detail and theory does not make it a good introductory book. In contrast, the books above present very clearly how to build a compiler, avoiding theory where it is not useful. This makes them superior recommendations for beginners.
The Dragon Book is best suggested for intermediate compiler authors, though they are likely to know of it already.
Partial list of questions so answered
- How to create a compiler in vb.net
- Learning Resources on Parsers, Interpreters, and Compilers
- Compilers and beyond
- Suggestions for writing a programming language?
- Interesting compiler projects
- What is the good approach to build a new compiler?
- Bootstrapping a language
- What happens when I compile?
- Compiler design resources
- Need Help Understanding Compilers/HLL->Assembly
- Unable to understand compilers' main optimizations
- How do C/C++ compilers work?
- Learning how programming languages work