The Pico Metacircular Evaluator
Pico by Theo D'Hondt, Documentation by Wolfgang De Meuter
In these pages, we explain the metacircular evaluator
for Pico. For the definition of metacircularity, we refer to the course "Interpretation Of Computer Programs I" (book: Abelson & Sussman: Structure and Interpretation of Computer Programs). For the informal definition of Pico, we refer to the
Pico web site and the courseware.
Please help us to debug this web site. Send bugs and report typos to Wolfgang
De Meuter (as Willem Hajenius already did a few years ago. Thanks!)
You can read all about
metacircularity.
The reason why we study a metacircular evaluator
is that
- By studying this volume of Pico code, we get to know Pico much better than
by merely studying small code excerpts and standard algorithms.
- By studying the code, we get a a precise definition of the semantics of
Pico. In fact, the code for the evaluator is the only precise definition of
the semantics. The only drawback of a metacircular definition is that it cannot
be used in practice because the resulting evaluator is too slow. But this
is solved by studying a full-fledged high speed interpreter (programmed in
C!) in the second part of the course "Interpretation of Computer Programs
2".
- Although the evaluator studied in this section is written specifically for
Pico, it contains the essential structure of any evaluator.
- By studying and experimenting with this metacircular evaluator, students
get acquainted with the entire discipline of interpreter building is a very
accessible way.
- The essence of meta circularity is that you only have to understand one
program in a language in order to understand all programs in that language.
The metacircular definition of Pico consists of several files containing Pico
code. This site uses a number of conventions.
Please, read them before moving on to the
Pico code.
This page was made (with lots of hard work!) by Wolfgang De Meuter