Home
Syllabus
Lecture Notes
Resources
|
CS4410/6410: Compilers
Spring 2013
Problem Set 4: Mapping Scish to Cish
Due Monday, 4 Mar 2013, 11:59pm (unofficially).
Officially due Monday, 12 Mar 2013, 11:59pm.
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
Download the assignment as a zip file.
You will find all of the files needed for this assignment in your directory.
The file README contains more detailed directions about what
you need to do. In particular, you will be modifying the
file scish_compile.ml to complete the parts that are missing.
Submitting your work
When you have completed the assignment, zip up your ps4 directory
as ps4-lastname1-lastname2 and email it to 4410staff at ccs.neu.edu.
|