Abstract:
John Hughes presents a new method for performing partial evaluation in [Hug96b]. The method is called type specialisation and functions much like a type checker. It infers its results. The static content of every sub-expression of the source program is derived. By letting this static content be the type of the expression, new specialised types are produced. The types are then propagated through the specialisation process independently of how code is residualised. This enables strong specialisations. This paper describes an implementation with a subset of Haskell as both the source and the residual (target) language. It is capable of handling Haskell's data types, including specialising constructors. One problem with Hughes ' specialiser was that it could not handle static tuples and projections on them properly. Here, a solution is presented; a postphase called projection unfolding. The method is capable of removing all static tuples provided neither the type of the program nor a sub-type of the type of
Citations
|
1128
|
Monads for functional programming
– Wadler
- 1992
|
|
801
|
A theory of type polymorphism in programming
– Milner
- 1978
|
|
552
|
Partial evaluation and automatic program generation
– Jones, Gomard, et al.
- 1993
|
|
496
|
S.: The Implementation of Functional Programming Languages
– Jones
- 1987
|
|
393
|
Comprehending monads
– Wadler
- 1992
|
|
215
|
Report on the Programming Language Haskell, A Non-strict, Purely Functional Language
– Hudak, Jones, et al.
- 1992
|
|
134
|
Partial evaluation of computation process - An approach to a compiler-compiler
– Futamura
- 1971
|
|
106
|
An experiment in partial evaluation: the generation of a compiler generator
– Jones, Sestoft, et al.
- 1989
|
|
82
|
Higher-order functions for parsing
– Hutton
- 1992
|
|
77
|
How to replace failure by a list of successes
– Wadler
- 1985
|
|
70
|
The Design of a Pretty-printing Library
– Hughes
- 1995
|
|
22
|
Partial evaluation, self-application and types
– Jones
- 1990
|
|
17
|
Constructor specialization
– Mogensen
- 1993
|
|
14
|
Type Specialisation for the Lambda-calculus; or, A New Paradigm for Partial Evaluation based on Type Inference
– Hughes
- 1996
|
|
10
|
An Introduction to Program Specialisation by Type Inference
– Hughes
- 1996
|
|
5
|
Evolution of partial evaluators: Removing inherited limits
– Mogensen
|
|
2
|
Arity raiser and its use in program specialisation
– Romanenko
- 1990
|