An evaluator (that is, an implementation) of a programming language, written in that langauge.

To a programmer accustomed only to Pascal-like languages, this might seem a bit pointless: a complete implementation of C, for instance, takes thousands of lines of code, and you end up with something you (per definition) already had.

Certain other langauges, however, make a point of providing the user with easy access to all the features of the implementation, and a metacircular evaluator can then defer all the hard work to the underlying implementation. For example, a complete Lisp system can be written in one line of Lisp:

(loop (print (eval (read))))

(The so-called read-eval-print loop, or REPL.) PostScript follows a similar design philosophy.

In at least the Lisp community, a standard way of describing or teaching language features has become to write a small metacircular evaluator, which explicitly handles the feature in question but leaves the other parts to the underlying implementation. Such evaluators can be extended and made more detailed throughout a course, so that you start with teaching the language, and end with providing a compiler for it.

The first influential text using this approch that I am aware of is Guy L. Steele and Gerald Jay Sussman's The Art of the Interpreter. Other examples are the well-known Structure and Interpretation of Computer Programs; Christian Queinnec 's Lisp in Small Pieces; and to some extent Essentials of Programming Languages by Daniel P. Friedman, Mitchell Wand, and Christopher T. Haynes. These texts all uses Scheme as their implementation langauge: the idea of metacircular evaulators is most popular in the Scheme community.

Log in or register to write something here or to contact authors.