Over the pasi decade, there have been several shifts in the way compilers are
built. New kinds of programming languages are being used: object-oriented
languages with dynamic methods, functional languages with nested scope
and first-class function closures; and many of these languages require garbage
collection. New machines have large register sets and a high penalty for mem
ory access, and can often run much faster with compiler assistance in schedul
ing instructions and managing instructions and data for cache locality.
This book is intended as a textbook for a one- or two-semester course
in compilers. Students will see the theory behind different components of a
compiler, the programming techniques used to put the theory into practice,
and the interfaces used to modularize the compiler. To make the interfaces
and programming examples clear and concrete, I have written them in the
ML programming language. Other editions of this book are available that use
the Ð¡ and Java languages.