Python interpreter in python?

Steven D. Majewski sdm7g at virginia.edu
Wed Dec 20 19:09:45 CET 2000


On Wed, 20 Dec 2000, Raymond Biurrun wrote:

> "Steven D. Majewski" <sdm7g at virginia.edu> escribi en el mensaje
> news:mailman.977254923.336.python-list at python.org...
> >
> > That is absolutely untrue!
> >
> > Lisp and Scheme are frequently implemented in themselves -- a
> > 'metacircular interpreter' is a fairly typical student exercise.
> >
> 
> Please excuse my ignorance but what's a "metacircular interpreter" and where
> can I find info about them.
> 

Thats just the fancy name they sometimes  use for a Lisp interpreter
written in Lisp. The top level loops on (PRINT (EVAL (READ))) -- 
and usually the exercise is to implement EVAL. 

It's a not uncommon exercise in Lisp or Scheme books.
( See <http://www.lisp.org/table/books.htm> for a list. ) 
The Structure and Interpretation of Computer Programs by Abelson,
Susman & Sussman (commmonly abreviated SICP) is one. 
Lisp In Small Pieces by Christian Queinnec, or John Allen's 
  (out of print) Anatomy of Lisp are a couple other I recall. 

Any of those or any of the other books on implementing Lisp are 
useful for understanding the implementation of any other symbolic
interpreted language (like Python, for example.) 
 Parsing is completely different -- Python has a more complicated
syntax -- but you can find info on parsing in any compiler book. 
 Python's solutions for symbol management and scoping are different,
but the problems are similar.

Lisp and Forth just happen to have a significant implementation
literature. Ralph Griswold has a good book on the implementation
of Icon, and I think had one on Snobol. For everything else --
Python, Perl, Tcl, Ruby, et.al., you mostly have just the source
code. 

-- Steve Majewski <sdm7g at Virginia.EDU> 






More information about the Python-list mailing list