Lab 7: Continuations
Bard College – Computer Science – Design of Programming Languages

In this lab we will explore continuations, one of the coolest and most difficult ideas in this class. Unlike most of our labs, the deliverable will be a report-an explainer. You will write a small client or example scheme program that demonstrates the technique, but your final product will be a write-up describing how your program (and continuations) work.

Prof. Matt Might gives five examples of using Scheme’s continuation facility call/cc in “Continuations by example: Exceptions, time-traveling search, generators, threads, and coroutines.” Select one of the five examples to explore more fully. Compare his implementation with the implementation in SICP, EOPL, or potentially some other language you might now (pthreads in C, Java’s exceptions, a DFS iterator in Java, Python’s generators). 

Thinking ahead for the final project, this lab provides practice explaining programs with prose.

Learning Goals

  • Write prose about programs.
  • Understand how continuations let us explicitly represent and manage control flow.
  • Compare features across programming languages.

Tips

  • Any code in the report should be properly formatted and syntax highlighted. 
  • (Pastebin can be used to generated nice HTML.)
  • Use figures to describe things visually in addition to English.

Submission Guidelines

By December 5th at midnight, submit via google classroom a file called:

cmsc305-lab7-lastname-firstname.pdf

Remember the file should include your name, email, date, assignment description and collaboration statement.  Bring a hard-copy of your programs to the following lab period. Your report should demonstrate your “Theory of the Program.”