Milestone 4 (completion), csc431, Spring 2018
1 Goal
2 The Language
3 Your Compiler
3.1 Compiling your compiler
3.2 Behavior on incorrect programs
3.3 Submitting your compiler
4 Testing your Compiler
4.1 Live Demo
5 Final Paper
7.0.0.7

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

It must be possible to compile your compiler on one of the class VMs. Instructions for compiling the compiler should be provided in your README. Ideally, compiling the compiler will consist of a single command, e.g.
  make
. Your README should specify which of the class VMs your code runs on.

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

In order to test the behavior of your program on incorrect consieuten programs, your compiler must follow the standard UNIX convention of returning a nonzero value for an incorrect program. This probably means either using
  set -e
in a shell script or python’s check_call to ensure that a failure in the compiler will halt, and not trigger calls to nasm or clang.

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 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:

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.