Programming Languages: Application and Interpretation
Copyright © 2003-07, Shriram Krishnamurthi
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License
Version 2007-04-26

Please see my brief essay about the educational philosophy behind this book. In particular, I discuss why this is a much more appropriate book for a modern programming languages course than a traditional one based on “paradigms”.

At present, I am aware of 52 universities (and some high-schools) that have used part or all of the book. Users range from major research universities to liberal arts colleges, from public to private universities, and cover four continents.

If you're an educator (teaching at a University, College, High School, Grammar School, Hochschule, Gymnasium, etc.), please let me know!

Electronic Version Print Version

You can download the April 26, 2007 Version as a single PDF file (~1.4Mb), free-of-cost.

If you prefer, you can also pay to download. No, this is not a joke. You're being given a choice in case you want to reward the author in kind. You lose nothing, however, by opting for the free version: it really is the entire book, no strings attached.

I recommend using DrRacket version 5.0.2 and subsequent releases. DrRacket comes with the PLAI language pre-installed. (DrRacket is the new name for DrScheme.) If you use 5.0.2, you do not need the patch below.

If you must use version 5.0.1, note that there is unfortunately a bug in the distributed version. Please install the patch as follows: save the patch file to disk; in DrRacket, go to File | Install .plt File...; select the saved file. This will apply the patch and re-build DrRacket. (Ignore the “duplicate tag” warnings you see. You should not see any errors.) Restart DrRacket.

For programs in the book, select the language level called “Use the language declared in the source”. When you're ready to program, prefix each file with

#lang plai
and type away. For instance, type
#lang plai
(define-type NumTree
  [mt]
  [node (v number?)
        (l NumTree?)
        (r NumTree?)])
in the Definitions window, click Run, and you can successfully execute
(node 3 (mt) (mt))
in the Interactions window.

Note: For now on, there will be just one language level for the book. There are additional languages to support the garbage collection assignment. Type plai in the Help Desk to get documentation on all of these: click on the entry for the “plai module”; the garbage collection languages are indexed in the table-of-contents on the left.

Please examine the FAQ. (Perhaps you're wondering why this book isn't published formally?)

I am in the process of rewriting PLAI in a much more modular form. This also opens up the book to collaborations. The first example is a section on object-orientation. I'm delighted that Éric Tanter has begun to work on this. While I don't agree with all his design choices, it's a terrific start. I am discussing collaborations with others as well.

2007-04-26: (mostly small changes; no significant, high-level modifications)
addressed over fifty email messages containing suggestions and corrections
revised section on substitution
removed some more font problems
2006-01-15:
significantly expanded and improved discussion of programming by searching
improved discussion of lambda calculus, continuations, state, types
introduced first-order functions before higher-order functions
removed sections on stack and heap transformations
improved language support
significantly improved index
made several prose improvements
fixed some font problems
2004-12-08: (76 new pages of material)
significantly improved language support
appended final versions of interpreters to each section
created initial version of index
integrated notes on Programming in Haskell
significantly improved and integrated notes on Lambda Calculus
expanded discussion of continuations
added variable mutation to complement value mutation
improved discussion of polymorphism
added brief section on Programming Interactive Systems
made several local changes, including:
- removed colloquialisms and rough prose
- fixed typos
- added examples
2003-12-19:
added course organization details to preface
fixed several typos
improved font usage
appended final versions of interpreters to sections
2003-12-15:
first release