Compiling with Continuations/Andrew Appel

nick@dcs.edinburgh.ac.uk
Thu, 23 Jan 92 14:30:25 gmt

          From comp.compilers

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)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: nick@dcs.edinburgh.ac.uk
Keywords: books
Organization: Compilers Central
Date: Thu, 23 Jan 92 14:30:25 gmt

This might have been mentioned here before; I forget. Anyway, this
just landed on my desk:


Compiling with Continuations
Andrew Appel
Cambridge University Press 1992
ISBN 0-521-41695-7


I quote: "The control and data flow of a program can be represented using
continuations, a concept from denotational semantics that has practical
application in real compilers. The book shows how continuation-passing style
is used as an intermediate representation on which to perform optimizations
and program transformations. Continuations can be used to compile most
programming languages.
      "The method is illustrated in a compiler for the programming language
Standard ML. However, prior knowledge of ML is not necessary, as the author
carefully explains each concept as it arises.
      "This is the first book to show how concepts from the theory of
programming languages can be applied to the production of practical
optimizing compilers for modern languages such as ML. All the nitty-gritty
details of compiling to really good machine code are covered, including the
interface to a runtime system and garbage collector.
      "This book will be essential reading for compiler writers in both industry
and academe, as well as for students and researchers in programming-language
theory."


Chapters: Overview
Continuation-passing style
Semantics of the CPS
ML-specific optimizations
Conversion into CPS
Optimization of the CPS
Beta expansion
Hoisting
Common subexpressions
Closure conversion
Register spilling
Space complexity
The abstract machine
Machine-code generation
Performance evaluation
The runtime system
Parallel programming
Future directions


The book is written with reference to Standard ML, and is in that culture
(strong typing, garbage collection, higher-order functions) but I see no
reason why the technology shouldn't have much wider applicability, as the
sleeve notes (above) suggest.


It doesn't cover parsing, and only mentions typechecking where it's relevant
to code generation. I don't consider the former any great loss; we've known
how to write parsers for decades, and I'm getting sick of compiler books
which spend six chapters going over it all again. As far as typechecking
goes, I know a fair amount about the state of the art and published papers,
but not about books. Certainly, traditional compiler texts cover it totally
inadequately.


This book looks very interesting. Apart from anything else, it's a very
welcome change from things like the dreadful Dragon book and its
contemporaries which are steeped in 1970's UNIX culture and grub around with
lexical analysers, regular expressions, YACC, LEX, C, and so on. There are
very few *modern* compiler texts around, but this is certainly one of them.


Nick.
--


Post a followup to this message

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