TY - GEN
T1 - Finally tagless, partially evaluated tagless staged interpreters for simpler typed languages
AU - Carette, Jacques
AU - Kiselyov, Oleg
AU - Shan, Chung Chieh
PY - 2007
Y1 - 2007
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 CPS transformers. Our main idea is to encode HOAS using cogen functions rather than data constructors. In other words, we represent object terms not in an initial algebra but using the coalgebraic structure of the A-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 over the various ways to interpret it, yet statically assures that the interpreters never get stuck. To achieve self-interpretation and show Jones-optimality, we relate this exemplar of higher-rank and higher-kind polymorphism to plugging a term into a context of let-polymorphic bindings.
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 CPS transformers. Our main idea is to encode HOAS using cogen functions rather than data constructors. In other words, we represent object terms not in an initial algebra but using the coalgebraic structure of the A-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 over the various ways to interpret it, yet statically assures that the interpreters never get stuck. To achieve self-interpretation and show Jones-optimality, we relate this exemplar of higher-rank and higher-kind polymorphism to plugging a term into a context of let-polymorphic bindings.
UR - http://www.scopus.com/inward/record.url?scp=38149134579&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=38149134579&partnerID=8YFLogxK
M3 - Conference contribution
AN - SCOPUS:38149134579
SN - 9783540766360
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 222
EP - 238
BT - Programming Languages and Systems - 5th Asian Symposium, APLAS 2007, Proceedings
T2 - 5th Asian Symposium on Programming Languages and Systems, APLAS 2007
Y2 - 29 November 2007 through 1 December 2007
ER -