LISP and Symbolic Computation, 9(2/3)181-202
A Simple Reflective Interpreter
Stanley Jefferson, Department of Computer Science, Indiana University, Bloomington, IN 47405
Daniel P. Friedman, Department of Computer Science, Indiana University, Bloomington, IN 47405
Abstract: Procedurally reflective programming languages enable
user programs to semantically extend the language itself, by
permitting them to run at the level of the language implementation
with access to their context. The reflective tower, first introduced
by Brian Smith, is the principal architecture for such languages. It
is informally described as an infinitely ascending tower of
metacircular interpreters, connected by a mechanism that allows
programs at one level to run at the next higher level. Various
accounts of the reflective tower have been published, including a
metacircular definition, operational definitions, and denotational
definitions. We present an operational account of the main aspects of
the reflective tower, which we claim is simpler than previous
accounts. Our approach is to implement a finite tower where each level
literally runs the level directly below it. A complete Scheme
implementation is included.
Keywords: reflection, interpreter, Lisp
|
This article is not available online.
|
|