The book Programming Language Concepts (PLC) provides an introduction to programming language concepts and implementation technology, such as interpretation, compilation, type checking and type inference, abstract machines, and garbage collection.
This book takes an operational approach to programming language concepts, interpreters and compilers, thus enabling practical exercises and experiments. It covers basic concepts such as abstract syntax, interpretation, stack machines, compilation, type checking, and garbage collection techniques. Also, it covers more advanced topics such as polymorphic types, type inference using unification, co- and contravariant types, continuations, and backwards code generation with on-the-fly peephole optimization. The book presents the practical construction of lexers and parsers, but not the more theoretical aspects of regular expressions, automata, grammars and formal languages, which are well covered by many other texts.
The book's examples present several interpreters and compilers for toy languages, including a compiler for a small but usable subset of C, several abstract machines, a garbage collector, and ML-style polymorphic type inference. Each chapter has exercises based on such examples.
The book puts programming language concepts and constructs into their historical context and shows how they affect Java and C#, thus strengthening students' understanding of these widely used languages. The functional language F# is used as meta language throughout. Like other languages in the ML family, F# has datatypes and pattern matching and is strongly typed, and therefore is ideal for implementing language processors. An appendix provides a crash course in F#.
See the table of contents.
Order it from Amazon.com or Amazon.co.uk or straight from Springer.
There is a list of errata.
Related lectures and example code
| Chapter | Lecture slides | Examples |
|---|---|---|
| Chapter 1 and Appendix A | lecture01.pdf | intro.zip |
| Chapter 2 | lecture02.pdf | intcomp.zip |
| Chapter 3 | lecture03.pdf | expr.zip and usql.zip |
| Chapter 4 | lecture04.pdf | fun1.zip and typedfun.zip |
| Chapter 5 and 6 and section A.11 | lecture05.pdf | fun2.zip |
| Chapter 7 | lecture06.pdf | imp.zip and microc.zip |
| Chapter 8 | lecture07.pdf | microc.zip |
| Chapter 9 | lecture08.pdf | virtual.zip |
| Chapter 10 | lecture08.pdf | listc.zip |
| Chapter 11 | lecture09.pdf | cont.zip |
| Chapter 12 | lecture10.pdf | microc.zip and ex13-code.txt |