Harvard University, FAS

Home
Syllabus
Lecture Notes

ML Resources
MIPS and SPIM

Problem Set 5: Mapping Scish to Cish

Due Monday, 26 Oct 2009, 11:00am.


The goal of this project is to understand how lexically-scoped, nested, higher-order functions can be compiled. This provides the key foundations for implementations of modern functional languages including Scheme and ML. You will build a compiler that maps a subset of Scheme called Scish down to a slightly extended version of our Cish language. The translation depends upon a few new constructs that have been added to Cish, namely a malloc operation, first-class function pointers, and word loads and stores. You can either extend your compiler for Cish to handle these new constructs, or else use the Cish interpreter for this problem set. I would encourage you to use the interpreter and get things working there first, before trying to extend your Cish compiler. (An alternative is to change the pretty-printer for Cish code so that it spits out ANSI-C code which you can then compile using a C compiler such as gcc.)

Instructions

Create a directory ps5. Download the scish.zip zip file and unzip it within the ps5 directory. You should find a directory scish that contains all of the files that you will need for this assignment.

The file README contains more detailed directions about what you need to do. In particular, you will be modifying the file scish_compile.sml to complete the parts that are missing.

Submitting your work

Please use the CS153 submission script provided on the nice servers at ~lib153/bin/cs153submit. For each assignment, you should create a new subdirectory to hold all of the supplied files along with any file you create. When you have complete the assignment, submit your work with the following command:
# ~lib153/bin/cs153submit N dir
where N is the assignment number, and dir the the directory containing the files for the assignment. For example, if you are using a directory called ps5 for this assignment, you can submit your work with the command.
# ~lib153/bin/cs153submit 5 ps5

You can submit your work as many times as you like. Only the last submission will be graded. You can view your current submission using the submit command:

submit ls lib153 5
Show the time-stamp and size of your last submission for assignment 5.
submit contents lib153 5
Show the contents of your last submission for assignment 5.

For more information, see man submit on the nice servers.