From Naïve to Norvig On Deriving a PROLOG Compiler
Arthur Nunes-Harwitt · 2014
An interpreter is a concise definition of the semantics of a programming language and is easily implemented. A compiler is more difficult to construct, but the code that it generates runs faster than interpreted code. This paper introduces rules to transform an interpreter into a compiler, and then provides a concrete demonstration of the rules in the form of a derivation of a Prolog compiler, much like Norvig's, implemented in Common Lisp. This example also suggests that the approach can be applied to a wide range of interpreter implementations and related algorithms.