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

This page is for the first edition of the book. I have since completely rewritten the book from scratch. Though the general principles underlying this book remain the same, the new book has better prose, updated material, a somewhat different (and better) technical presentation, and fewer pages.

The second edition is available online, and I update it frequently.

HTML
PDF

The PDF version is still a bit rough, and needs more attention to formatting. I will attend to that after I'm done writing the content.

Because my focus is on this new edition, I am requesting that you not send me bug reports about the current edition. Of course, questions and technical comments are always welcome.

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.

If you are in India, you can get the book on paper for much cheaper via Pothi. Note: Though I trust the person who set it up (thank you for the initiative, Ramakrishnan Muthukrishnan!), I have not bought a copy to check the output. Also, I don't control any price fluctuations, nor do I get any royalties. Therefore, if you spot any problems, please notify me.

However, due to the availability of the second edition, I suggest you not purchase the above volumes. Please instead wait for the second edition to be finalized.

I recommend using DrRacket version 5.3 and subsequent releases. DrRacket comes with the PLAI language pre-installed. (DrRacket is the new name for DrScheme.)

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?)

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