Results 1 -
3 of
3
Online Type-Directed Partial Evaluation for Dynamically-Typed Languages
- Computer Software
, 1999
"... This article presents an alternative method of type-directed partial evaluation, which is simpler and more efficient than previous methods. Unlike previous methods, it is straightforwardly applicable to functional languages with various powerful type systems. As an extreme instance, this article mai ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
This article presents an alternative method of type-directed partial evaluation, which is simpler and more efficient than previous methods. Unlike previous methods, it is straightforwardly applicable to functional languages with various powerful type systems. As an extreme instance, this article mainly deals with a dynamically-typed functional language like Scheme. The key idea is to extend primitive value destructors such as function application and pair destruction (car and cdr), so that they generate residual code when their operands are dynamic. It unnecessitates an operation in type-directed partial evaluation called reflection, which was the major cause of complication and inefficiency in previous methods. We formalize our method as an extension of two-level -calculus, and prove it correct. Furthermore, we show that our type-directed partial evaluator can be derived from a simple online syntax-directed partial evaluator with higher-order abstract syntax, by the same transformatio...
Two Flavors of Offline Partial Evaluation
, 1998
"... . Type-directed partial evaluation is a new approach to program specialization for functional programming languages. Its merits with respect to the traditional offline partial evaluation approach have not yet been fully explored. We present a comparison of type-directed partial evaluation with stand ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
. Type-directed partial evaluation is a new approach to program specialization for functional programming languages. Its merits with respect to the traditional offline partial evaluation approach have not yet been fully explored. We present a comparison of type-directed partial evaluation with standard offline partial evaluation in both a qualitative and quantitative way. For the latter we use implementations of both approaches in Scheme. Both approaches yield equivalent results in comparable time. 1 Introduction Partial evaluation is a technique for automatically specializing programs. One approach is offline partial evaluation where specialization is entirely driven by the results of a program analysis. We consider two offline frameworks which are superficially quite different. In the traditional approach the program analysis is a binding-time analysis, an abstraction of the semantics of specialization. A binding-time analysis determines for each program point whether the specialize...
Deriving a Statically Typed Type-Directed Partial Evaluator
- In Danvy [12
, 1999
"... Type-directed partial evaluation was originally implemented in Scheme, a dynamically typed language. It has also been implemented in ML, a statically Hindley-Milner typed language. This note shows how the latter implementation can be derived from the former through a functional representation of ind ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
Type-directed partial evaluation was originally implemented in Scheme, a dynamically typed language. It has also been implemented in ML, a statically Hindley-Milner typed language. This note shows how the latter implementation can be derived from the former through a functional representation of inductively dened types. 1 Introduction Type-directed partial evaluation is an approach to specializing a term written in a higher-order language. Such a higher-order term is specialized by normalizing it with respect to its type. Normalization is done by eta-expanding the term in a two-level lambda-calculus and statically betareducing the expanded term. The two stages | eta-expansion and beta-reduction | share an intermediate result: a two-level term. We consider two versions of the type-directed partial evaluation algorithm: (i) If the two-level term is represented as a value of an inductively dened data type then the algorithm can be implemented in any (Turing complete) language. In thi...

