Language Extension via First-class Interpreters

Refci is an extensible re ective language based on the re ective tower model. The Refci interpreter procedures are rei able, rst-class objects, and user programs can directly modify the interpreter by extending them. This allows user code to be run directly as part of, and at the level of, the interpreter. By installing a modi ed or extended interpreter, user programs can modularly extend the language and implement debugging aids. We present the extensible rst-class interpreter and give examples of its use. Examples include stepping, breakpoints, and interrupts. We show how the re ective tower, modeled by the metacontinuation, maintains the proper level of interpretation when running an interpreter containing both system code and user code.