Hostname: page-component-77c78cf97d-4gwwn Total loading time: 0 Render date: 2026-04-27T00:11:44.539Z Has data issue: false hasContentIssue false

Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages

Published online by Cambridge University Press:  15 April 2009

JACQUES CARETTE
Affiliation:
McMaster University (e-mail: carette@mcmaster.ca)
OLEG KISELYOV
Affiliation:
FNMOC (e-mail: oleg@pobox.org)
CHUNG-CHIEH SHAN
Affiliation:
Rutgers University (e-mail: ccshan@rutgers.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2009
Submit a response

Discussions

No Discussions have been published for this article.