Results 11 - 20
of
46
Partial Evaluation for Higher-Order Languages with State
, 1996
"... We have designed and implemented an offline partial evaluator for a higher-order language with first-class references. Its distinguishing feature over other partial evaluators is its ability to perform assignments to local and global references at specialization time for a higher-order language. The ..."
Abstract
-
Cited by 23 (7 self)
- Add to MetaCart
We have designed and implemented an offline partial evaluator for a higher-order language with first-class references. Its distinguishing feature over other partial evaluators is its ability to perform assignments to local and global references at specialization time for a higher-order language. The partial evaluator consists of a region-based monovariant binding-time analysis and a specializer in essentially continuation-passing store-passing style, thus generalizing type-based binding-time analysis and continuation-based partial evaluation. The partial evaluator yields good results for realistic problems such as object-oriented programming, unification, and specializer generation. Keywords: higher-order programming, program transformation, partial evaluation, state Categories: D.1.1 Applicative (Functional) Programming, D.1.2 Automatic Programming, D.3.1 Formal Definitions and Theory, Semantics, D.3.2 Language Classifications, Applicative languages, D.3.4 Processors, I.2.2 Automatic...
Eta-Expansion does the Trick
- ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS
, 1996
"... Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuationpassing style, eta-expansion, and a popul ..."
Abstract
-
Cited by 22 (6 self)
- Add to MetaCart
Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuationpassing style, eta-expansion, and a popular transformation called "The Trick". We provide a unified view of these binding-time improvements, from a typing perspective. Just as a
Is Continuation-Passing Useful for Data Flow Analysis?
- Proceedings of the ACM SIGPLAN'94 Conference on Programming Languages Design and Implementation, SIGPLAN Notices
, 1994
"... The widespread use of the continuation-passing style (CPS) transformation in compilers, optimizers, abstract interpreters, and partial evaluators reflects a common belief that the transformation has a positive effect on the analysis of programs. Investigations by Nielson [13] and Burn/Filho [5, 6] s ..."
Abstract
-
Cited by 21 (5 self)
- Add to MetaCart
The widespread use of the continuation-passing style (CPS) transformation in compilers, optimizers, abstract interpreters, and partial evaluators reflects a common belief that the transformation has a positive effect on the analysis of programs. Investigations by Nielson [13] and Burn/Filho [5, 6] support, to some degree, this belief with theoretical results. However, they do not pinpoint the source of increased abstract information and do not explain the observation of many people that continuation-passing confuses some conventional data flow analyses. To study the impact of the CPS transformation on program analysis, we derive three canonical data flow analyzers for the core of an applicative higher-order programming language. The first analyzer is based on a direct semantics of the language, the second on a continuation-semantics of the language, and the last on the direct semantics of CPS terms. All analyzers compute the control flow graph of the source program and hence our result...
Two for the Price of One: Composing Partial Evaluation and Compilation
, 1997
"... One of the flagship applications of partial evaluation is compilation and compiler generation. However, partial evaluation is usually expressed as a source-to-source transformation for high-level languages, whereas realistic compilers produce object code. We close this gap by composing a partial eva ..."
Abstract
-
Cited by 20 (3 self)
- Add to MetaCart
One of the flagship applications of partial evaluation is compilation and compiler generation. However, partial evaluation is usually expressed as a source-to-source transformation for high-level languages, whereas realistic compilers produce object code. We close this gap by composing a partial evaluator with a compiler by automatic means. Our work is a successful application of several meta-computation techniques to build the system, both in theory and in practice. The composition is an application of deforestation or fusion. The result is a run-time code generation system built from existing components. Its applications are numerous. For example, it allows the language designer to perform interpreter-based experiments with a source-to-source version of the partial evaluator before building a realistic compiler which generates object code automatically.
RML -- A New Language and Implementation for Natural Semantics
- PROCEEDINGS OF THE 6TH INTERNATIONAL SYMPOSIUM ON PROGRAMMING LANGUAGE IMPLEMENTATION AND LOGIC PROGRAMMING, PLILP, VOLUME 884 OF LNCS
, 1994
"... RML is a programming language intended for the implementation of Natural Semantics specifications. The basic procedural elements are relations: many-to-many mappings defined by a number of axioms or inference rules. It has control flow, logical variables and (explicit) unification as in Prolog; from ..."
Abstract
-
Cited by 15 (2 self)
- Add to MetaCart
RML is a programming language intended for the implementation of Natural Semantics specifications. The basic procedural elements are relations: many-to-many mappings defined by a number of axioms or inference rules. It has control flow, logical variables and (explicit) unification as in Prolog; from ML it borrows a polymorphic type system, data structures, and pattern matching; a facility for separatelycompilable modules also exists. A simple prototype compiler, based on translating RML to Continuation-Passing Style and then to C, has been implemented. Benchmarks indicate that this compiler generates code that is several orders of magnitude faster than Typol, and two times faster than standard Prolog compilers.
Type Specialisation for the lambda-calculus, or A New Paradigm for Partial Evaluation based on Type Inference
"... this paper is to propagate static information via residual types. For example, when we specialise a static integer the residual expression is a dummy value, but the residual type tells us which static value it represents: 3 : int ,! ffl : 3 Here `3' is a type with only one element, namely ffl, and w ..."
Abstract
-
Cited by 15 (3 self)
- Add to MetaCart
this paper is to propagate static information via residual types. For example, when we specialise a static integer the residual expression is a dummy value, but the residual type tells us which static value it represents: 3 : int ,! ffl : 3 Here `3' is a type with only one element, namely ffl, and which therefore has just the same elements as 4, 5, 6 etc. --- but which carries different static information. All expressions, even `dynamic' ones, carry static information in the form of a residual type. For purely dynamic expressions this is just an ordinary type, for example 3 : int ,! 3 : int
A Type-directed, On-line, Partial Evaluator for a Polymorphic Language
- In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation
, 1997
"... Recently, Olivier Danvy introduced a new, simple method for implementing powerful partial evaluators, namely typedirected partial evaluation[9]. He introduced a partial evaluator for the simply-typed lambda calculus (x2). This paper explores the possibility of using the same techniques over a lambda ..."
Abstract
-
Cited by 13 (3 self)
- Add to MetaCart
Recently, Olivier Danvy introduced a new, simple method for implementing powerful partial evaluators, namely typedirected partial evaluation[9]. He introduced a partial evaluator for the simply-typed lambda calculus (x2). This paper explores the possibility of using the same techniques over a lambda calculus with a richer type system. We generalize and extend Danvy's work in four ways: 1. Our system handles a much richer language than that presented by Danvy, including all of the features functional programmers have come to expect, such as polymorphism (x5), inductive datatypes (x10), and recursion (x9). 2. Our system includes a new systematic treatment of primitive operators (x7) and the propagation of residualized code (x7.1). This question has either been ignored or treated in an ad-hoc manner in previous work. 3. Our system handles non-closed terms (x6). This makes type-directed partial evaluation much more practically useful, and can easily be extended to work in languages wit...
Separating Stages in the Continuation-Passing Style Transformation
- Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages
, 1993
"... The continuation-passing style (CPS) transformation is powerful but complex. Our thesis is that this transformation is in fact compound, and we set out to stage it. We factor the CPS transformation into several steps, separating aspects in each step: 1. Intermediate values are named. 2. Continuation ..."
Abstract
-
Cited by 13 (6 self)
- Add to MetaCart
The continuation-passing style (CPS) transformation is powerful but complex. Our thesis is that this transformation is in fact compound, and we set out to stage it. We factor the CPS transformation into several steps, separating aspects in each step: 1. Intermediate values are named. 2. Continuations are introduced. 3. Sequencing order is decided and administrative reductions are performed. Step 1 determines the evaluation order (e.g., call-by-name or call-by-value). Step 2 isolates the introduction of continuations and is expressed with local, structure-preserving rewrite rules --- a novel aspect standing in sharp contrast with the usual CPS transformations. Step 3 determines the ordering of continuations (e.g., left-to-right or right-to-left evaluation) and leads to the familiar-looking continuationpassing terms. Step 2 is completely reversible and Steps 1 and 3 form Galois connections. Together they leading to the direct style (DS) transformation of our earlier work (including first...
The Formal Relationship Between Direct and Continuation-Passing Style Optimizing Compilers: A Synthesis of Two Paradigms
, 1994
"... Compilers for higher-order programming languages like Scheme, ML, and Lisp can be broadly characterized as either "direct compilers" or "continuation-passing style (CPS) compilers", depending on their main intermediate representation. Our central result is a precise correspondence between the two co ..."
Abstract
-
Cited by 13 (0 self)
- Add to MetaCart
Compilers for higher-order programming languages like Scheme, ML, and Lisp can be broadly characterized as either "direct compilers" or "continuation-passing style (CPS) compilers", depending on their main intermediate representation. Our central result is a precise correspondence between the two compilation strategies. Starting from
On the Transformation between Direct and Continuation Semantics
- Proceedings of the 9th Conference on Mathematical Foundations of Programming Semantics, number 802 in Lecture Notes in Computer Science
, 1993
"... . Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that direct-style -terms can be transformed into continuation style automatically. However, transforming the representation of a direct-style semantics into continuation sty ..."
Abstract
-
Cited by 13 (10 self)
- Add to MetaCart
. Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that direct-style -terms can be transformed into continuation style automatically. However, transforming the representation of a direct-style semantics into continuation style usually does not yield the expected representation of a continuation-style semantics (i.e., one written by hand). The goal of our work is to automate the transformation between textual representations of direct semantics and of continuation semantics. Essentially, we identify properties of a direct-style representation (e.g., totality), and we generalize the transformation into continuation style accordingly. As a result, we can produce the expected representation of a continuation semantics, automatically. It is important to understand the transformation between representations of direct and of continuation semantics because it is these representations that get processed in any kind of ...

