This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: CPS transformation and partial evaluation
On Sat, Aug 12, 2000 at 03:38:54PM +0200, Jost Boekemeier wrote:
> [translating foreign languages into scheme]
> > We have wonderful tools such as partial evaluators and cps. For
> > example, it's not necessary to use tagbody forms or continuations to
> > handle jumps.
>
> Yeah. Do you have references to good papers that discuss partial
> evaluators? All I've red about CPS is that although it is easy to do
> certain optimizations after CPS transformation it is possible and
> probably better to do the optimizations in the source language.
> [I think I've seen comments from Matthias Felleisen about it, but
> I can't remember when and where].
When I first tried tcl->scheme, I wrote it using a partial evaluator
(Similix). Though in retrospect there were a lot of things I did
quite wrong, I think the failure of that experiment also had a lot to
do with a lack of robustness in the tools. Maybe newer partial
evaluators are better now. (I think I also had much more faith in the
partial evaluators than I should have, and gave the evaluator more
flexibility to optimize than it could handle)
I got the impression that there wasn't a lot of very serious use of
partial evaluators -- it was more about theoretical possibilities than
actually being able to use them in practice.
In the end, I realized that any one specific problem space (i.e., any
one language) could be tackled much more reasonably by using the
particular ideas of a partial evaluator that apply. Full generality
is seldom needed. In tcl->scheme I felt that an object system that
allowed multiple representations of a single piece of data was much
simpler and more appropriate than a partial evaluator -- as well as
more efficient both during run- and compile-time.
I wouldn't actively discourage using a partial evaluator, but the idea
of a partial evaluator as something that can turn an interpreter into
a compiler is, IMHO, far-fetched (though some documentation gives the
impression it is practical).
-- Ian