## Generating a pattern matching compiler by partial evaluation (1990)

Venue: | Functional Programming |

Citations: | 9 - 1 self |

### BibTeX

@INPROCEEDINGS{Jørgensen90generatinga,

author = {Jesper Jørgensen},

title = {Generating a pattern matching compiler by partial evaluation},

booktitle = {Functional Programming},

year = {1990},

pages = {177--195},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

Partial evaluation can be used for automatic generation of compilers and was first implemented in [10]. Since partial evaluation was extended to higher order functional languages [9] [2] it has become possible to write denotational semantics definitions of languages and implement these with very few changes in the language treated by partial evaluators. In this paper we use this technique to generate a compiler for a small strict combinator language with pattern matching. First, a simple denotational specification for the language is written and a compiler is generated. This first compiler turns out not to generate too efficient code. By changing the denotational specification, new compilers that generate more efficient code are obtained. This process can be described as generating optimizing compilers by changing specifications. The optimization concerns generation of object code for pattern matching and the final compiler does in fact generate very efficient code for this. Specifically, it treats non-uniform function definitions in a satisfactory way. The optimization performed can be viewed as being equivalent to the well-known compiler optimization called common subexpression elimination.

### Citations

627 |
V.R.: Fast pattern matching in strings
- Knuth, Morris, et al.
- 1977
(Show Context)
Citation Context ... [5] where the matching problem is to find a given substring within another string. A general string pattern matcher is rewritten several times finaly leading to the Knuth, Morris and Pratt algorithm =-=[11]-=-. The difference between their work and ours is that while we treat many patterns and that these are trees with variables, they only treat one one constant pattern (the substring). The first published... |

327 |
Denotational Semantics: A Methodology for Language Development
- Schmidt
- 1986
(Show Context)
Citation Context ... extensions of the work, and in section 5 we give a comparison with related work. Section 6 contains a conclusion. 1.3 Prerequisites Knowledge of partial evaluation [10] and of denotational semantics =-=[13]-=- is required. 1.4 Notation In denotational definitions v* is an abbreviation of a sequence of v’s. If D is the name of a syntactical domain then D* is the domain of sequences of elements from D. Lists... |

168 | The concept of a supercompiler
- Turchin
- 1986
(Show Context)
Citation Context ...ter if one could improve the process of partial evaluation in such a way that no rewriting is nessesary. Two methods generalizing the ideas used in partial evaluation look promising: Supercompilation =-=[15]-=- and Generalized Partial Computation [7]. 7 Acknowledgement Many people have contributed in various ways; but I would especially like to thank Anders Bondorf, Torben Mogensen, Olivier Danvy and Neil D... |

122 |
An experiment in partial evaluation: The generation of a compiler generator
- Jones, Sestoft, et al.
- 1985
(Show Context)
Citation Context ...penhagen Universitetsparken 1, DK-2100 Copenhagen Ø Denmark e-mail: knud@diku.dk May 9, 1994 Abstract Partial evaluation can be used for automatic generation of compilers and was first implemented in =-=[10]-=-. Since partial evaluation was extended to higher order functional languages [9] [2] it has become possible to write denotational semantics definitions of languages and implement these with very few c... |

117 | Automatic autoprojection of recursive equations with global variables and abstract data types
- Bondorf, Danvy
- 1991
(Show Context)
Citation Context ...tivation for this work. ∗ This work was supported by ESPRIT Basic Research Actions project 3124 “Semantique” 1 Miranda is a trademark of Research Software Ltd. 1sThe partial evaluator used is Similix =-=[4]-=- [2], an autoprojector for a higher order subset of Scheme [12], including both lambda abstractions and side effects on global variables. The fact that the language is a member of the LISP family make... |

99 |
An overview of miranda
- Turner
- 1986
(Show Context)
Citation Context ...mpiler generation, i.e. generating compilers from interpreters [10]. Another is algorithms involving pattern or string matching [6] [5]. Since many functional languages like Haskell [8] and Miranda 1 =-=[16]-=- use pattern matching, it is natural to ask if it is possible, using partial evaluation, to generate a compiler that compiles function definitions with pattern matching into efficient matching code. T... |

90 |
Automatic autoprojection of higher order recursive equations
- Bondorf
- 1991
(Show Context)
Citation Context ...9, 1994 Abstract Partial evaluation can be used for automatic generation of compilers and was first implemented in [10]. Since partial evaluation was extended to higher order functional languages [9] =-=[2]-=- it has become possible to write denotational semantics definitions of languages and implement these with very few changes in the language treated by partial evaluators. In this paper we use this tech... |

81 |
Compiling pattern matching
- Augustsson
- 1985
(Show Context)
Citation Context ...ns v* is an abbreviation of a sequence of v’s. If D is the name of a syntactical domain then D* is the domain of sequences of elements from D. Lists of values are written in a Prolog like style, e.g. =-=[1,2,3]-=- and [h|t]. Otherwise the notation follows [13] where a conditional is written → , function updating [ ↦→ ] and strict lambdas λv.e is a shorthand notation for λv.v=⊥ → ⊥ e. ρ is a variable environmen... |

80 |
Report on the Programming Language Haskell
- Hudak, Jones, et al.
- 1992
(Show Context)
Citation Context ...ss is automatic compiler generation, i.e. generating compilers from interpreters [10]. Another is algorithms involving pattern or string matching [6] [5]. Since many functional languages like Haskell =-=[8]-=- and Miranda 1 [16] use pattern matching, it is natural to ask if it is possible, using partial evaluation, to generate a compiler that compiles function definitions with pattern matching into efficie... |

43 | Partial evaluation of pattern matching in strings
- Consel, Danvy
- 1989
(Show Context)
Citation Context ... evaluation have been used with considerable success is automatic compiler generation, i.e. generating compilers from interpreters [10]. Another is algorithms involving pattern or string matching [6] =-=[5]-=-. Since many functional languages like Haskell [8] and Miranda 1 [16] use pattern matching, it is natural to ask if it is possible, using partial evaluation, to generate a compiler that compiles funct... |

39 |
Efficient compilation of pattern-matching
- Wadler
- 1987
(Show Context)
Citation Context ... of a pattern matching compiler is Augustsson’s description of the techniques used in the LML compiler [1]. A good description where Augustsson’s work is pressented and extended is given by Wadler in =-=[17]-=-. The following example is taken from this, except that the right hand sides have been slightly changed: (demo (f ’() ys = ys) (f xs ’() = xs) (f (x : xs) (y : ys) = (f x y) : (demo xs ys))) Compiling... |

27 |
The structure of a self-applicable partial evaluator
- Sestoft
(Show Context)
Citation Context ...s; it makes specifications (interpreters) easier to read, and when specializing the interpreters values are not returned, but passed as arguments to continuations, which then gives variable splitting =-=[14]-=-. S-cont is the domain of success continuation and F-env the domain of failure continuation. Semantic domains: ρ ∈ V-env = Variable → Value φ ∈ F-env = Function-name → Value* → Value κs ∈ S-cont = V-e... |

12 | A selfapplicable partial evaluator for the lambda calculus
- Jones, Gomard, et al.
- 1990
(Show Context)
Citation Context ...May 9, 1994 Abstract Partial evaluation can be used for automatic generation of compilers and was first implemented in [10]. Since partial evaluation was extended to higher order functional languages =-=[9]-=- [2] it has become possible to write denotational semantics definitions of languages and implement these with very few changes in the language treated by partial evaluators. In this paper we use this ... |

9 |
Compiling laziness by partial evaluation
- Bondorf
- 1990
(Show Context)
Citation Context ...ns v* is an abbreviation of a sequence of v’s. If D is the name of a syntactical domain then D* is the domain of sequences of elements from D. Lists of values are written in a Prolog like style, e.g. =-=[1,2,3]-=- and [h|t]. Otherwise the notation follows [13] where a conditional is written → , function updating [ ↦→ ] and strict lambdas λv.e is a shorthand notation for λv.v=⊥ → ⊥ e. ρ is a variable environmen... |

4 |
Revised Report 3 on the Algorithmic Language Scheme, Sigplan Notices 21,12
- Rees, Clinger
- 1986
(Show Context)
Citation Context ...sic Research Actions project 3124 “Semantique” 1 Miranda is a trademark of Research Software Ltd. 1sThe partial evaluator used is Similix [4] [2], an autoprojector for a higher order subset of Scheme =-=[12]-=-, including both lambda abstractions and side effects on global variables. The fact that the language is a member of the LISP family makes it well suited for directly implementing denotational semanti... |

2 |
From abstract model to efficient compilation of patterns
- Emanuelson
- 1982
(Show Context)
Citation Context ...tial evaluation have been used with considerable success is automatic compiler generation, i.e. generating compilers from interpreters [10]. Another is algorithms involving pattern or string matching =-=[6]-=- [5]. Since many functional languages like Haskell [8] and Miranda 1 [16] use pattern matching, it is natural to ask if it is possible, using partial evaluation, to generate a compiler that compiles f... |