TY - JOUR
T1 - Finally tagless, partially evaluated
T2 - Tagless staged interpreters for simpler typed languages
AU - Carette, Jacques
AU - Kiselyov, Oleg
AU - Shan, Chung Chieh
PY - 2009/9
Y1 - 2009/9
N2 - 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.
AB - 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.
UR - http://www.scopus.com/inward/record.url?scp=74149083935&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=74149083935&partnerID=8YFLogxK
U2 - 10.1017/S0956796809007205
DO - 10.1017/S0956796809007205
M3 - Article
AN - SCOPUS:74149083935
SN - 0956-7968
VL - 19
SP - 509
EP - 543
JO - Journal of Functional Programming
JF - Journal of Functional Programming
IS - 5
ER -