Re: Partial evaluation vs flow-graph analysis

Jacques.Noye@emn.fr (Jacques Noye 0251858248)
25 May 1997 12:59:30 -0400

          From comp.compilers

Related articles
[5 earlier articles]
Purify patent (was Re: gawk memory leak) elan@jeeves.net (Elan Feingold) (1997-05-04)
Re: Purify patent (was Re: gawk memory leak) krish@cs.purdue.edu (Sailesh Krishnamurthy) (1997-05-08)
Re: Purify patent (was Re: gawk memory leak) pfox@lehman.com (Paul David Fox) (1997-05-13)
Re: Purify patent (was Re: gawk memory leak) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Partial evaluation vs flow-graph analysis fabre@gr.osf.org (Christian Fabre) (1997-05-22)
Re: Partial evaluation vs flow-graph analysis mossin@diku.dk (1997-05-25)
Re: Partial evaluation vs flow-graph analysis Jacques.Noye@emn.fr (1997-05-25)
Re: Partial evaluation vs flow-graph analysis thorn@spamblock.lalla.irisa.fr (Tommy Thorn) (1997-05-27)
| List of all articles for this month |
From: Jacques.Noye@emn.fr (Jacques Noye 0251858248)
Newsgroups: comp.compilers
Date: 25 May 1997 12:59:30 -0400
Organization: Compilers Central
References: 97-03-165 97-04-020 97-04-022 97-04-037 97-04-070 97-05-019 97-05-090 97-05-162 97-05-216 97-05-254
Keywords: optimize,bibliography

Christian Fabre & Francois de Ferriere wrote:
> Partial evaluation seems to be a hot topic in the compiler field
> nowaday. As far as we've understood, the basic idea is to partially
> evaluate (sic) a program based on the information we are able to
> gather about its arguments. This requires some sort of intrepreter
> (or is it a meta-interpreter?) to compute the simplified program.
>
> Did we miss something obvious so far?


Not much, but this is not very far :-) An interesting further step is,
for instance, to compile the interpreter.


Have a look at:


@Article{Jones:96,
    author = {Jones, N.D.},
    title = {An Introduction to Partial Evaluation},
    journal = {ACM Computing Surveys},
    year = 1996,
    volume = 28,
    number = 3,
    month = sep,
    pages = {480-503}
}


and


@InProceedings{Consel-Danvy:popl93,
    author = {Consel, C. and Danvy, O.},
    title = {Tutorial Notes on Partial Evaluation},
    crossref = {popl93},
    pages = {493-501}
}


@Proceedings{popl93,
    title = {Proceedings of the Twentieth Annual ACM
                                    SIGPLAN-SIGACT Symposium on Principles Of
                                    Programming Languages},
    booktitle = {Proceedings of the Twentieth Annual ACM
                                    SIGPLAN-SIGACT Symposium on Principles Of
                                    Programming Languages},
    year = 1993,
    month = jan,
    publisher = {ACM Press},
    address = {Charleston, South Carolina}
}


> This makes us think that the kind of tasks well suited for partial
> evaluation can also be done, for most of them, with "older" techniques
> such as flow-graph equations.
>
> So our question is what kind of optimisations will partial evaluation
> make possible that are out of reach of a classical optimizer (and
> vice-versa)?
>
> Is there some paper comparing the two techniques?


There is quite a number of techniques which can be both used as the basis
for building optimizing compilers and partial evaluators (data-flow equations,
abstract interpretation, type inference...) but the objectives of traditional
optimizing compilers and partial evaluators are quite different, just think
about their input and output (an important point is that a partial evaluator
takes an execution context as input, not a compiler).
On can expect however to see both worlds overlap more and more (as shown, for
instance, by the interest in "procedure cloning" and constant propagation
in the compiler community, or dynamic code generation in the partial evaluation
community).


> Also, most of the papers talk about PE in the context of functional
> languages like ML or Haskell. Is this technique also usefull/usable
> for imperative languages like C, C++, Java or Eiffel?


Of course, have a look, for instance, at the work on C-Mix at DIKU
(http://www.diku.dk/topps/activities/cmix.html), and the work on TEMPO and
Harissa (C and Java) at IRISA (http://www.irisa.fr/EXTERNE/projet/compose/).


There has also been work on other imperative languages (e.g. on Pascal, by
Meyer, et al.), see the bibliography on partial evaluation at DIKU
(ftp://ftp.diku.dk/diku/semantics/partial-evaluation/).


-- Jacques NOYE
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.