Results 1 - 10
of
28
Tutorial Notes on Partial Evaluation
- Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages
, 1993
"... The last years have witnessed a flurry of new results in the area of partial evaluation. These tutorial notes survey the field and present a critical assessment of the state of the art. 1 Introduction Partial evaluation is a source-to-source program transformation technique for specializing program ..."
Abstract
-
Cited by 230 (60 self)
- Add to MetaCart
The last years have witnessed a flurry of new results in the area of partial evaluation. These tutorial notes survey the field and present a critical assessment of the state of the art. 1 Introduction Partial evaluation is a source-to-source program transformation technique for specializing programs with respect to parts of their input. In essence, partial evaluation removes layers of interpretation. In the most general sense, an interpreter can be defined as a program whose control flow is determined by its input data. As Abelson points out, [43, Foreword], even programs that are not themselves interpreters have important interpreter-like pieces. These pieces contain both compile-time and run-time constructs. Partial evaluation identifies and eliminates the compile-time constructs. 1.1 A complete example We consider a function producing formatted text. Such functions exist in most programming languages (e.g., format in Lisp and printf in C). Figure 1 displays a formatting functio...
Type-directed partial evaluation
- Proceedings of the Twenty-Third Annual ACM Symposium on Principles of Programming Languages
, 1996
"... Abstract. Type-directed partial evaluation stems from the residualization of arbitrary static values in dynamic contexts, given their type. Its algorithm coincides with the one for coercing asubtype value into a supertype value, which itself coincides with the one of normalization in the-calculus. T ..."
Abstract
-
Cited by 195 (38 self)
- Add to MetaCart
Abstract. Type-directed partial evaluation stems from the residualization of arbitrary static values in dynamic contexts, given their type. Its algorithm coincides with the one for coercing asubtype value into a supertype value, which itself coincides with the one of normalization in the-calculus. Type-directed partial evaluation is thus used to specialize compiled, closed programs, given their type. Since Similix, let-insertion is a cornerstone of partial evaluators for callby-value procedural programs with computational e ects. It prevents the duplication of residual computations, and more generally maintains the order of dynamic side e ects in residual programs. This article describes the extension of type-directed partial evaluation to insert residual let expressions. This extension requires the userto annotate arrowtypes with e ect information. It is achieved by delimiting and abstracting control, comparably to continuation-based specialization in direct style. It enables type-directed partial evaluation of e ectful programs (e.g.,ade nitional lambda-interpreter for an imperative language) that are in direct style. The residual programs are in A-normal form. 1
Representing control: a study of the CPS transformation
, 1992
"... This paper investigates the transformation of v -terms into continuation-passing style (CPS). We show that by appropriate j-expansion of Fischer and Plotkin's two-pass equational specification of the CPS transform, we can obtain a static and context-free separation of the result terms into "esse ..."
Abstract
-
Cited by 69 (6 self)
- Add to MetaCart
This paper investigates the transformation of v -terms into continuation-passing style (CPS). We show that by appropriate j-expansion of Fischer and Plotkin's two-pass equational specification of the CPS transform, we can obtain a static and context-free separation of the result terms into "essential" and "administrative" constructs. Interpreting the former as syntax builders and the latter as directly executable code, we obtain a simple and efficient one-pass transformation algorithm, easily extended to conditional expressions, recursive definitions, and similar constructs. This new transformation algorithm leads to a simpler proof of Plotkin's simulation and indifference results. Further we show how CPS-based control operators similar to but more general than Scheme's call/cc can be naturally accommodated by the new transformation algorithm. To demonstrate the expressive power of these operators, we use them to present an equivalent but even more concise formulation of t...
For a Better Support of Static Data Flow
- Functional Programming Languages and Computer Architecture
"... . This paper identifies and solves a class of problems that arise in binding time analysis and more generally in partial evaluation of programs: the approximation and loss of static information due to dynamic expressions with static subexpressions. Solving this class of problems yields substantial b ..."
Abstract
-
Cited by 58 (16 self)
- Add to MetaCart
. This paper identifies and solves a class of problems that arise in binding time analysis and more generally in partial evaluation of programs: the approximation and loss of static information due to dynamic expressions with static subexpressions. Solving this class of problems yields substantial binding time improvements and thus dramatically better results not only in the case of partial evaluation but also for static analyses of programs --- this last point actually is related to a theoretical result obtained by Nielson. Our work can also be interpreted as providing a solution to the problem of conditionally static data, the dual of partially static data. We point out which changes in the control flow of a source program may improve its static data flow. Unfortunately they require one to iterate earlier phases of partial evaluation. We show how these changes are subsumed by transforming the source program into continuation-passing style (CPS). The transformed programs get specializ...
Architecturing software using a methodology for language development
- Proceedings of the 10 th International Symposium on Programming Language Implementation and Logic Programming, number 1490 in Lecture Notes in Computer Science
, 1998
"... Domain-speci c languages (DSLs) can be viewed from both a programming language and a software architecture perspective. The goal of this paper is to relate the two viewpoints. In particular, we demonstrate that DSLs can be constructed using an existing formal methodology for developing general purpo ..."
Abstract
-
Cited by 43 (15 self)
- Add to MetaCart
Domain-speci c languages (DSLs) can be viewed from both a programming language and a software architecture perspective. The goal of this paper is to relate the two viewpoints. In particular, we demonstrate that DSLs can be constructed using an existing formal methodology for developing general purpose
Lambda-Dropping: Transforming Recursive Equations into Programs with Block Structure
, 2001
"... Lambda-lifting a block-structured program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack ..."
Abstract
-
Cited by 32 (10 self)
- Add to MetaCart
Lambda-lifting a block-structured program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack
Syntactic Accidents in Program Analysis: On the Impact of the CPS Transformation
- Journal of Functional Programming
, 2000
"... Our results formalize and confirm a folklore theorem about traditional bindingtime analysis, namely that CPS has a positive effect on binding times. What may be more surprising is that the benefit does not arise from a standard refinement of program analysis, as, for instance, duplicating continuati ..."
Abstract
-
Cited by 25 (9 self)
- Add to MetaCart
Our results formalize and confirm a folklore theorem about traditional bindingtime analysis, namely that CPS has a positive effect on binding times. What may be more surprising is that the benefit does not arise from a standard refinement of program analysis, as, for instance, duplicating continuations.
From interpreting to compiling binding times
- Proceedings of the 3rd European Symposium on Programming
, 1990
"... The key to realistic self-applicable partial evaluation is to analyze binding times in the source program, i.e., whether the result of partially evaluating a source expression is static or dynamic, given a static/dynamic division of the input. Source programs are specialized with respect to the stat ..."
Abstract
-
Cited by 25 (7 self)
- Add to MetaCart
The key to realistic self-applicable partial evaluation is to analyze binding times in the source program, i.e., whether the result of partially evaluating a source expression is static or dynamic, given a static/dynamic division of the input. Source programs are specialized with respect to the static part of their input. When a source expression depends on the concrete result of specializing another expression, the binding time of this other expression is first interpreted. A safe approximation of these abstract values is computed by binding time analysis. This paper points out that this value-based information can be compiled into control-based directives driving the specializer as to what to do for each expression – instead of how to use the result of partially evaluating an expression. This compilation is achieved by a non-standard interpretation of the specialization semantics, based on the observation that a source expression is either reduced or rebuilt. The result is an action trees isomorphic to the abstract syntax tree of the source program. This approach suggests to reorganize the specializer so that it is driven first
Semantics-Based Compiling: A Case Study in Type-Directed Partial Evaluation
- Eighth International Symposium on Programming Language Implementation and Logic Programming
"... . We illustrate a simple and e#ective solution to semantics-based compiling. Our solution is based on "type-directed partial evaluation", and -- our compiler generator is expressed in a few lines, and is e#cient; -- its input is a well-typed, purely functional definitional interpreter in the sty ..."
Abstract
-
Cited by 21 (8 self)
- Add to MetaCart
. We illustrate a simple and e#ective solution to semantics-based compiling. Our solution is based on "type-directed partial evaluation", and -- our compiler generator is expressed in a few lines, and is e#cient; -- its input is a well-typed, purely functional definitional interpreter in the style of denotational semantics; -- the output of the generated compiler is e#ectively three-address code, in the fashion and e#ciency of the Dragon Book; -- the generated compiler processes several hundred lines of source code per second. The source language considered in this case study is imperative, blockstructured, higher-order, call-by-value, allows subtyping, and obeys stack discipline. It is bigger than what is usually reported in the literature on semantics-based compiling and partial evaluation. Our compiling technique uses the first Futamura projection, i.e., we compile programs by specializing a definitional interpreter with respect to the program. Specialization is carri...
Semantics-Directed Compilation of Non-Linear Patterns
- Information Processing Letters
, 1990
"... This paper describes the automatic derivation of compiled patterns and of a pattern compiler by partial evaluation. Compiling a pattern is achieved by specializing a pattern matching program with respect to the pattern. Generating a pattern compiler is achieved by specializing the specializer with r ..."
Abstract
-
Cited by 18 (4 self)
- Add to MetaCart
This paper describes the automatic derivation of compiled patterns and of a pattern compiler by partial evaluation. Compiling a pattern is achieved by specializing a pattern matching program with respect to the pattern. Generating a pattern compiler is achieved by specializing the specializer with respect to the pattern matching program, i.e., by self-applying the partial evaluator. The compiled patterns and the compiler are semantics-based because they are obtained using meaning-preserving transformations upon the definitional pattern matching program and the partial evaluator. The results are unexpectedly good: not only all are the operations depending on the pattern (syntax analysis, resolution of cross-references due to the non-linearity) performed at compile time, but whereas the general pattern matcher builds the substitution environment incrementally and for nothing in case of failure, compiled patterns perform all the structural and equality tests first, and build the result on...

