Subject: Re: continuations are mandatory for compilers?
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 24 Dec 2001 06:20:05 GMT
Newsgroups: comp.lang.scheme
Message-ID: <a06hel$2l8gd$1@fido.engr.sgi.com>
William D Clinger <cesura@qnci.net> wrote:
+---------------
| Fabien Letouzey asked:
| > That is, is the compilation process tightly bound with continuations,
| > making them a mandatory step?
| 
| No.  Although there is some interaction between continuations and
| compilers, there isn't much.
+---------------

Also see:

	<URL:http://www.ccs.neu.edu/scheme/pubs/pldi93-fsdf.ps.gz>
	Flanagan, Sabry, Duba and Felleisen
	"The Essence of Compiling with Continuations"

which introduces "A-Normal Form" (ANF), a transformation on source
code which allows a direct-style compiler many of the benefits of
the traditional CPS transformation without having to deal with CPS.

[Actually, ANF can be quite useful to a "fast interpreter" or "half-
compiler", too, one that's already doing a pre-pass to rename lexical
variables and/or convert lexical environments to either "flat" or
"display/offset" style.]

From a very quick look around, this appears to still be an area of
active study, with more alternative to CPS than just ANF. See
<URL:http://citeseer.nj.nec.com/context/23509/174731> for a number
of other papers which deal with these issues.


-Rob

-----
Rob Warnock, 30-3-510		<rpw3@sgi.com>
SGI Network Engineering		<http://www.meer.net/~rpw3/>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA

[Note: aaanalyst@sgi.com and zedwatch@sgi.com aren't for humans ]