Journal of Functional Programming · 2009 · 270 citations · 67 references
ComputingComputer ScienceCompilersComputational LinguisticsProgramming LanguagesAbstract Syntax TreesFormal LanguagesInterpreter DesignSyntax AnalysisType CheckingType SystemsInterpreters
Tagless interpreters provide a way to write interpreters for typed languages without explicit runtime tags, leveraging the host language’s type system. The authors encode de Bruijn or higher‑order abstract syntax with combinator functions, enabling a statically type‑preserving interpreter, compiler, partial evaluator, and CPS transformers that simulate inductive type maps. They built the first family of tagless interpretations for a higher‑order typed object language in a typed metalanguage that requires no dependent types, GADTs, or post‑processing, and the encoding uniformly abstracts over interpretation strategies while statically guaranteeing that interpreters never get stuck, illustrating the benefit of higher‑kinded type abstraction.
Abstract We have built the first family of tagless interpretations for a higher-order typed object language in a typed metalanguage (Haskell or ML) that require no dependent types, generalized algebraic data types, or postprocessing to eliminate tags. The statically type-preserving interpretations include an evaluator, a compiler (or staged evaluator), a partial evaluator, and call-by-name and call-by-value continuation-passing style (CPS) transformers. Our principal technique is to encode de Bruijn or higher-order abstract syntax using combinator functions rather than data constructors. In other words, we represent object terms not in an initial algebra but using the coalgebraic structure of the λ-calculus. Our representation also simulates inductive maps from types to types, which are required for typed partial evaluation and CPS transformations. Our encoding of an object term abstracts uniformly over the family of ways to interpret it, yet statically assures that the interpreters never get stuck. This family of interpreters thus demonstrates again that it is useful to abstract over higher-kinded types.
67
A theory of type polymorphism in programming
Robin Milner · Journal of Computer and System Sciences · 1978 · 2.2K citations · Full text
Notions of computation and monads
Eugenio Moggi · Information and Computation · 1991 · 1.7K citations
Call-by-name, call-by-value and the λ-calculus
Gordon Plotkin · Theoretical Computer Science · 1975 · 1.2K citations
LCF considered as a programming language
Gordon Plotkin · Theoretical Computer Science · 1977 · 1.1K citations
Definitional interpreters for higher-order programming languages
John Reynolds · 1972 · 668 citations