Programming language semantics based on pure rewrite rules suffers from the gap between the rewriting strategy implemented in rewriting engines and the intended evaluation strategy. This paper shows how programmable rewriting strategies can be used to implement interpreters for programming languages based on rewrite rules. The advantage of this approach is that reduction rules are first class entities that can be reused in different strategies, even in other kinds of program transformations such as optimizers. The approach is illustrated with several interpreters for the lambda calculus based on implicit and explicit (parallel) substitution, different strategies including normalization, eager evaluation, lazy evaluation, and lazy evaluation with updates. An extension with pattern matching and choice shows that such interpreters can easily be extended. ©2002 Published by Elsevier Science B.V.
Dolstra, E., & Visser, E. (2002). Building interpreters with rewriting strategies. In Electronic Notes in Theoretical Computer Science (Vol. 65, pp. 57–76). Elsevier. https://doi.org/10.1016/S1571-0661(04)80427-4