This homework involves pushing a random program through the hoops of the CPS transformation, representation-independant treatment of continuations, record representation of continuations, registerization, and (unframed) stack representation of continuations.
The good news is that since you're already so good at CPS, we've done that part for you.
The bad news is that the random program we've picked for you is the Scheme interpreter.
This is not as bad as it seems, unless you get wigged out about it. If you treat the interpreter as ``just another random program'' and do the transformations as automatically as possible, you'll do fine. If you somehow think that doing these transformations to THE INTERPRETER (all must bow) is something special, you'll psych yourself out.
That's not to say that this assignment is a cake walk. The main problem will be debugging. Here, I will provide the recommend debugging cycle for this assignment:
You should place your continuations on a stack, but you should not place your environments on a stack. This means you should do the transformations of EOPL 10.2, but not 10.3.
As a starting point for this assignment, feel free to take this CPSed interpreter, which is brazenly stolen from EOPL.
You should hand in a fully registerized and stackified
interpreter. There should be a procedure named run which
takes an expression, parses it into records, sets up the initial
registers and the stack properly, starts up the interpreter, and then
returns the value in the final register.
Good luck, and have fun.
Write your answers to the exercises in a file (with comments, following the proper indentation rules), and send that file to
c311@lakshmi.cs.indiana.eduwith the subject line
11Assuming you've saved your homework in the file ``asgn.ss'' in the current directory, one way to submit is with the command:
Mail -s "11" c311@lakshmi.cs.indiana.edu < asgn.ss
remember to include the line
(load "record.ss")
at the beginning of your file.
Back to the c311 page
ehilsdal@cs.indiana.edu