3.11 Analysis: Continuations

The suggested length is 5 pages.

Write a paper about first-class control (i.e. continuations) and tail-call optimization.

You can write about whatever you want provided you demonstrate a solid understanding. Here are a few suggestions you might consider in starting this assignment, but please do not feel constrained by this list, as it is not comprehensive. Please feel free to contact me directly so we can discuss the direction you want to take with the paper.

- 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.