Related articles |
---|
Compiling with Continuations/Andrew Appel nick@dcs.edinburgh.ac.uk (1992-01-23) |
Re: Compiling with Continuations/Andrew Appel eifrig@blaze.cs.jhu.edu (1992-01-27) |
Re: Compiling with Continuations/Andrew Appel norman@parc.xerox.com (1992-01-27) |
Re: Compiling with Continuations/Andrew Appel carlton@husc10.harvard.edu (1992-01-27) |
Re: Compiling with Continuations/Andrew Appel delacour@parc.xerox.com (Vincent Delacour) (1992-01-28) |
Re: Compiling with Continuations/Andrew Appel bimbart@cs.kuleuven.ac.be (1992-01-29) |
Re: Compiling with Continuations/Andrew Appel boehm@parc.xerox.com (1992-01-29) |
Re: Compiling with Continuations/Andrew Appel oz@ursa.sis.yorku.ca (1992-01-29) |
Re: Compiling with Continuations/Andrew Appel ulrich@mips.complang.tuwien.ac.at (1992-01-30) |
Newsgroups: | comp.compilers |
From: | norman@parc.xerox.com (Norman Adams) |
Keywords: | books, ML, storage |
Organization: | Xerox PARC |
References: | 92-01-091 92-01-101 |
Date: | Mon, 27 Jan 1992 15:48:46 PST |
nick@dcs.edinburgh.ac.uk mentions:
> Compiling with Continuations
> Andrew Appel
> Cambridge University Press 1992
> ISBN 0-521-41695-7
eifrig@blaze.cs.jhu.edu (Jonathan Eifrig) responds:
> There are good reasons why the methods described may not be a good
> model of compilation for all languages. The continuation-style
> method basically converts the source language into executable code
> for a machine model _with_a_heap_. While this is OK if the
> language you are compiling will need a heap anyways (such as Lisp
> or ML, or any other language where functions are first-class
> objects), it may not be appropriate for simpler languages, like C
> or Algol, for which a simple run-time stack is sufficient.
A GC'd heap is not a requirement for a language implemention where the
compiler uses continations as the intermediate representation.
See "Compilation by Program Transformation" by Richard Kelsey (his PhD
thesis -- YALEU/CDD/RR #702, May 1989 ). He presents a `continuation
passing' compiler with Pascal, Basic, and Scheme front-ends.
If you language includes first class procedures, or if you decide to
represent your control stack with closures (as I believe SML of NJ does),
then you need a heap.
Even when a language needs a heap, the compiler can chose a runtime stack
as the appropriate represention for continuations. The T compiler does
this. A little bit of information on the T compiler is available in
"Orbit: An Optimizing Compiler for Scheme" by David Kranz et al, in
Proceedings of the SIGPLAN '86 Symposium on Compiler Construction. pp
219-233. Published as SIGPLAN Notices 21(7), July 1986.
There is more in Kranz's thesis, a Yale CS tech report --
YALEU/DCS/RR-632, Feb 1988. (Though, I have had no luck in getting tech
reports from Yale.)
-Norman
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.