Results 1 -
9 of
9
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...
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...
Generating Transformers for Deforestation and Supercompilation
- Static Analysis, volume 864 of Lecture Notes in Computer Science
, 1994
"... . Our aim is to study how the interpretive approach --- inserting an interpreter between a source program and a program specializer --- can be used to improve the transformation of programs and to automatically generate program transformers by self-application of a program specializer. We show ..."
Abstract
-
Cited by 25 (7 self)
- Add to MetaCart
. Our aim is to study how the interpretive approach --- inserting an interpreter between a source program and a program specializer --- can be used to improve the transformation of programs and to automatically generate program transformers by self-application of a program specializer. We show that a few semantics-preserving transformations applied to a straightforward interpretive definition of a first-order, call-by-name language are sufficient to generate Wadler's deforestation algorithm and a version of Turchin's supercompiler using a partial evaluator. The transformation is guided by the need to binding-time improve the interpreters. 1 Introduction Our aim is to study the interpretive approach to improve the transformation of source programs and to automatically generate stand-alone transformers [Tur93, GJ94]. The essence of the interpretive approach is to insert an interpreter between a source program and a generic program specializer. As defined by the specializer pro...
Generating a Compiler for a Lazy Language by Partial Evaluation
, 1992
"... Compiler generation is often emphasized as being the most important application of partial evaluation. But most of the larger practical applications have, to the best of our knowledge, been outside this field. Especially, no one has generated compilers for languages other that small languages. This ..."
Abstract
-
Cited by 20 (2 self)
- Add to MetaCart
Compiler generation is often emphasized as being the most important application of partial evaluation. But most of the larger practical applications have, to the best of our knowledge, been outside this field. Especially, no one has generated compilers for languages other that small languages. This paper describes a large application of partial evaluation where a realistic compiler was generated for a strongly typed lazy functional language. The language, that was called BAWL, was modeled after the language in Bird and Wadler [BW88] and is a combinator language with pattern matching, guarded alternatives, local definitions and list comprehensions. The paper describes the most important techniques used, especially the binding time improvements needed in order to get small and efficient target programs. Finally, the performance of the compiler is compared with two compilers for similar languages: Miranda and LML. Keywords Compiler generation, partial evaluation, binding time improvemen...
Sharing of Computations
, 1993
"... This report is a revised version of my thesis of the same title, which was accepted for the Ph.D. degree in Computer Science at University of Aarhus, Denmark, in June 1993 ..."
Abstract
-
Cited by 14 (3 self)
- Add to MetaCart
This report is a revised version of my thesis of the same title, which was accepted for the Ph.D. degree in Computer Science at University of Aarhus, Denmark, in June 1993
Dynamic Optimization through the use of Automatic Runtime Specialization
, 1999
"... Profile-driven optimizations and dynamic optimization through specialization have taken optimizations to a new level. By using actual runtime data, optimizers can generate code that is specially tuned for the task at hand. However, most existing compilers that perform these optimizations require s ..."
Abstract
-
Cited by 14 (2 self)
- Add to MetaCart
Profile-driven optimizations and dynamic optimization through specialization have taken optimizations to a new level. By using actual runtime data, optimizers can generate code that is specially tuned for the task at hand. However, most existing compilers that perform these optimizations require separate test runs to gather profile information, and/or user annotations in the code. In this thesis, I describe runtime optimizations that a dynamic compiler can perform automatically --- without user annotations --- by utilizing realtime performance data. I describe the implementation of the dynamic optimizations in the framework of a Java Virtual Machine and give performance results.
ML pattern match compilation and partial evaluation
, 1996
"... : We derive a compiler for ML-style pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of naive string matchers. Following that paradigm, we first present a general and naive ML pattern ma ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
: We derive a compiler for ML-style pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of naive string matchers. Following that paradigm, we first present a general and naive ML pattern matcher, instrument it to collect and exploit extra information, and show that partial evaluation of the instrumented general matcher with respect to a given match produces an efficient specialized matcher. We then discard the partial evaluator and show that a match compiler can be obtained just by slightly modifying the instrumented general matcher. The resulting match compiler is interesting in its own right, and naturally detects inexhaustive matches and redundant match rules. 1 Introduction Consel and Danvy [3] studied a general string matcher, taking two inputs: a pattern string to look for, and an object string to look in. The matcher finds the first occurrence (if any) of the pattern ...
Optimizing Pattern Matching
- In ICFP’01 Proceedings
, 2001
"... We present improvements to the backtracking technique of pattern-matching compilation. Several optimizations are introduced, such as commutation of patterns, use of exhaustiveness information, and control ow optimization through the use of labeled static exceptions and context information. These opt ..."
Abstract
-
Cited by 8 (0 self)
- Add to MetaCart
We present improvements to the backtracking technique of pattern-matching compilation. Several optimizations are introduced, such as commutation of patterns, use of exhaustiveness information, and control ow optimization through the use of labeled static exceptions and context information. These optimizations have been integrated in the ObjectiveCaml compiler. They have shown good results in increasing the speed of pattern-matching intensive programs, without increasing nal code size.
Partial Evaluation applied to Symbolic Pattern Matching with Intelligent Backtrack
- Workshop in Static Analysis, number 81–82 in Bigre
, 1992
"... Symbolic pattern matching as offered by Lisp dialects allows to scan Sexpressions, to verify their shape and to extract or compare subparts of them. A rich set of patterns exists and among them alternate patterns. Such patterns are handled through backtrack: a failure forces the pattern matcher to r ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Symbolic pattern matching as offered by Lisp dialects allows to scan Sexpressions, to verify their shape and to extract or compare subparts of them. A rich set of patterns exists and among them alternate patterns. Such patterns are handled through backtrack: a failure forces the pattern matcher to regress to its last point of choice and to try another branch. The usual naive backtrack algorithm forgets all the informations acquired on the datum from the last point of choice up to the failure point. Our algorithm provides intelligent backtrack i.e. these informations are given back to the pattern matcher which can then use them to choose the appropriate backtrack point therefore eliminating redundant tests or dead-end branches. It turns out that this very simple idea "Don't throw any information painfully acquired", forms the basis of many clever algorithms such as Knuth-Morris-Pratt (KMP) or Boyer-Moore (BM) for strings, Hoffmann-O'Donnell for trees etc. The other benefit comes from th...

