3.15 Analysis: Continuations

In about 5 pages (approximately 325 80-character lines or 2,750 words), write a paper about first-class control (i.e. continuations) and tail-call optimization.

Provided you write intelligently and demonstrate your understanding of continuations you can write about whatever you’d like. If that is too vague for you, or if you need some guidance, here are some suggestions:

- What is the essential idea of continuation-passing style?

- Is conversion to continuation-passing style an optimization? Why or why not? Are there reasons it might be slower? How could you counter them?

- Is tail-call optimization really an "optimization" or is it a design choice that changes how you program? Why or why not? Is that a good thing? Specifically relate it to Object-Oriented programming, perhaps.

- How could you implement continuations directly in a language without conversion to CPS? Discuss some of the design and performance challenges.

- Are there programs you have written in the past that would have been better had you understood continuations beforehand? Explain why, why not, how, etc.

- Have you used continuations before and did not realize it? Explain.

- Read Beating the Averages, by Paul Graham, and some of the things it links to. Respond to them.

- Learn about other control operators you can build with first-class control: prompts, delimited pipes, zippers, demonic control, user-level threads, co-routines, generators, engines, etc. Describe them and react to them.

- How does stack inspection (a la Java) interact with tail-call optimization? (Read about continuation marks.)

- Is a language with first-class control "better" or more "powerful" than one without?

Refer to Language Analysis the First for details about including citations, history, code, etc in your writing in this class.