@gron

Engineering Definitional Interpreters

, , and . Proceedings of the 15th Symposium on Principles and Practice of Declarative Programming, page 121--132. New York, NY, USA, ACM, (2013)
DOI: 10.1145/2505879.2505894

Abstract

A definitional interpreter should be clear and easy to write, but it may run 4--10 times slower than a well-crafted bytecode interpreter. In a case study focused on implementation choices, we explore ways of making definitional interpreters faster without expending much programming effort. We implement, in OCaml, interpreters based on three semantics for a simple subset of Lua. We compile the OCaml to x86 native code, and we systematically investigate hundreds of combinations of algorithms and data structures. In this experimental context, our fastest interpreters are based on natural semantics; good algorithms and data structures make them 2--3 times faster than naïve interpreters. Our best interpreter, created using only modest effort, runs only 1.5 times slower than a mature bytecode interpreter implemented in C.

Description

Engineering definitional interpreters

Links and resources

Tags

community

  • @gron
  • @dblp
@gron's tags highlighted