Results 1 -
3 of
3
Finally Tagless, Partially Evaluated -- Tagless Staged Interpreters for Simpler Typed Languages
- UNDER CONSIDERATION FOR PUBLICATION IN J. FUNCTIONAL PROGRAMMING
"... 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 ..."
Abstract
-
Cited by 53 (9 self)
- Add to MetaCart
(Show Context)
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 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.
Memoization in type-directed partial evaluation
- PROCEEDINGS OF THE 2002 ACM SIGPLAN/SIGSOFT CONFERENCE ON GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, NUMBER 2487 IN LECTURE NOTES IN COMPUTER SCIENCE
, 2002
"... We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the function ..."
Abstract
-
Cited by 14 (6 self)
- Add to MetaCart
(Show Context)
We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and type-directed partial evaluation provides a convenient setting to obtain the normal form of their composition. However, off-the-shelf type-directed partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending type-directed partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields orders-of-magnitude improvements both in time and in space for type isomorphisms.
unknown title
"... Abstract Domain Specific Languages (DSLs) are a promising solution for implementing robust and efficient operating system extensions for embedded systems. When such extensions need to be dynamically loaded as source code, the need for efficiency implies that DSL programs must be JIT compiled. Nevert ..."
Abstract
- Add to MetaCart
(Show Context)
Abstract Domain Specific Languages (DSLs) are a promising solution for implementing robust and efficient operating system extensions for embedded systems. When such extensions need to be dynamically loaded as source code, the need for efficiency implies that DSL programs must be JIT compiled. Nevertheless, development of a JIT compiler for a new language is difficult. We propose to generate a DSL compiler from a DSL interpreter by automatic run-time program specialization.