Book contents
- Frontmatter
- Abstract
- Contents
- Preface
- 1 Partial Evaluation in Principle
- 2 Partial Evaluation in Practice
- 3 Static Projections
- 4 Binding-Time Analysis
- 5 Run Time Arguments
- 6 Implementation
- 7 Polymorphism
- 8 Conclusion
- A Implementation of PEL
- B Implementation of BTA
- C Implementation of Specialisation
- D Library Functions
- Bibliography
- Index
- Frontmatter
- Abstract
- Contents
- Preface
- 1 Partial Evaluation in Principle
- 2 Partial Evaluation in Practice
- 3 Static Projections
- 4 Binding-Time Analysis
- 5 Run Time Arguments
- 6 Implementation
- 7 Polymorphism
- 8 Conclusion
- A Implementation of PEL
- B Implementation of BTA
- C Implementation of Specialisation
- D Library Functions
- Bibliography
- Index
Summary
We have studied some of the theoretical aspects of using projections in binding-time analysis and how, again in theory, the dependent sum construction can be used to define the run-time arguments. In this chapter we will draw these threads together in the implementation of a projection-based partial evaluator. The current version is written in LML [Aug84] and not in PEL itself, so it is not yet self-applicable. Indeed there are still some problems about self-application of LML-like languages, which we discuss in the concluding chapter.
One slightly surprising feature is that the moderately complicated dependent sum construction turns out to be almost trivial to implement. In contrast, however, the binding-time analysis is fairly intricate because of the complexity involved in representing projections. Of necessity, parts of the following will interest only those intending to produce an implementation themselves. Anyone uninterested in the gory details should skim much of this chapter and turn to the final section where we develop the extended example.
General
A PEL program, as defined in Chapter 4, consists of type definitions followed by a series of function definitions. At the end of these is an expression to be evaluated. The value of this expression gives the value of the whole program. When we intend to partially evaluate a program we present it in exactly the same form except that the final expression is permitted to have free variables. These free variables indicate non-static data.
- Type
- Chapter
- Information
- Project Factorisations in Partial Evaluation , pp. 75 - 85Publisher: Cambridge University PressPrint publication year: 1991