Milestone 4 (completion), csc431, Spring 2018
1 Goal
The goal of the final submission is to produce a feature-complete compiler with two optimizations, and a final paper describing your compiler and the effectiveness of its optimizations.
2 The Language
The consieuten language is unchanged from Milestone 3.
3 Your Compiler
As before, your compiler should accept a source file, and produce a binary executable.
Your compiler should accept a flag, indicating the level of optimization. Here’s the command-line syntax:
consieuten -O<n> <source file>
The optimization level -O0 should instruct the compiler to perform no optimizations. The optimization level -O4 should instruct the compiler to perform all available optimizations. The meaning of the intermediate numbers (-O1, -O2, -O3) is up to you; document your choice in your README.
3.1 Compiling your compiler
Please please please make sure that your compiler compiles and runs cleanly on the VM. Part of your grade will be based on how difficult it was to compile your compiler.
3.2 Behavior on incorrect programs
3.3 Submitting your compiler
As before, you should submit your compiler by pushing to the master branch of your classroom github repo before the deadline.
The deadline is 7 pm on Tuesday, June 12th.
4 Testing your Compiler
As before, I will test your compilers using a set of test programs, grouped into categories. Here’s the breakdown of points:
The simplest possible program: 8 points
Straight-line code: 4 points
Top-level first-order functions: 4 points
Higher-order top-level functions: 1 point
Inner functions: 1 point
Branching with if: 1 point
While loops: 1 point
Structures: 3 points
I/O: 2 points
Closure Conversion: 2 points
Everything tests: 2 points
Type-Checking: 3
Optimization: 4 points
Code Quality: 4 points
The last two of these are exceptions: they are not computed based simply on a yes-no result of a set of tests.
I will release the tests on Tuesday night. Why would you care when I release the tests? Well, because if you’d like to remove some of the suspense, you may participate in the...
4.1 Live Demo
On Wednesday, from 10 AM to 1 PM in room 14-301 (the standard lab room), I will be conducting live demos. These will use exactly the same set of tests as my grading scripts, and you must use the compiler as it is submitted on Tuesday night. I will ask you to run each test in turn, and I will record the results.
I would encourage you to write a script, that runs all of the files at once; this will speed up the testing process enormously.
The advantage of the live demo is that you know right away which tests you passed and which ones you didn’t.
Please note that I reserve the right to re-run the tests off-line if a major problem crops up; for instance, I discover that there’s a terrible bug in one of the tests, etc. I don’t expect to have to do this, but you never know.
5 Final Paper
Another component of the class is the final paper, which describes your compiler, and also the results of running an experiment on your optimizations.
From the course syllabus, here’s the description of the paper:
This paper must:
Outline the overall architecture of the solution,
outline the representation of key data (e.g., IR and instructions),
outline optimizations implemented, and
provide a section detailing the performance of the code generated for the benchmarks. This section must contain graphs comparing the run-times of the generated code (with and without optimizations) and the C equivalent code compiled using gcc or clang (with and without optimizations).
You should regard this paper more or less as containing two large sections; the first describes your compiler, and the second describes the results of an experiment you performed on the optimization that you implemented.
The first half is more or less a README for the architecture of your code; imagine that you’re handing off your code to a junior dev, and you want to make sure that he or she understands the code well enough not to mess up all your hard work.
The second half is more or less a lab writeup, as you might perform in a Chemistry or Physics class: you want to describe the experiment in sufficient detail that the reader can reproduce the results, and you want to discuss the results of the experiment in sufficient detail that the reader can decide whether it’s worth his or her time. Try to provide some insight into what kind of speedup the optimization provides, and on what kinds of program it seems to work best.
Your paper should be formatted as a PDF, and submitted by pushing it to your repo, by the same deadline.