
A Tour Through Chapter 5 of <Essentials of Programming Languages> using Python.

===========================================================================

Essentials of Programming Languages
by Daniel P. Friedman, Mitchell Wand, Christopher T. Haynes

Hardcover, 536 pages
Published by MIT Press
Publication date: February 1992
ISBN: 0262061457 

===========================================================================

The interpreter is started in chapter 5.  Each subdirectory contains
the implementation up to that chapter/section, often with a few of
the exercises done.

I've gone with the non-lispish syntax, using Aaron Watters' kwParsing
module to implement the parser.  The lisp syntax would of course be
even easier, requiring only a simple recursive-descent parser.

Python is excellent for experimenting with programming languages: By
the time we get to section 5.6, we have a parser and interpreter for
the core of a language based on the lambda calculus, in <400 lines of
code.

5.1) A Simple Interpreter
5.2) Conditional Evaluation
5.3) Local Binding
5.4) Procedures
5.5) Variable Assignment
5.6) Recursion
5.7) Dynamic Scope and Assignment [skipped]

...

9.2) Continuation-Passing Interpreter
  This is a version of the interpreter that has been rewritten in
  continuation-passing style.  The CPS interpreter specifies the
  semantics of recursion in a way that is independent of recursion
  in the defining language (Python).



