Christmas assignment (Compilers)

Copyright © 1993–2025 J. M. Spivey
Jump to navigation Jump to search

To encourage participants to develop practical skills, and to give them an opportunity to demonstrate them, the course culminates in a practical assignment done over the Christmas vacation. Participants are asked to perform a programming task, then to write up their work in a report. The task usually involves extending one of the toy compilers used during the lab sessions with new language features. The assignment often asks for additional test cases that demonstrate the working of the new features.

  • A sample report shows a workable format, with a small (and relatively unchallenging) part of one of the lab exercises written up as if it were the practical assignment.

Some helpful hints

There are various options for setting up an environment for completing the task on your own computer, listed on the software setup page. Among them is a new 'virtual appliance' that runs under VirtualBox, and immediately provides everything you might need.

I wrote my solutions using the same TEX (not LaTEX) format as the coursebook, with nicely printed ML code, but you need not do anything similar: a simple word-processed document with code shown in a monospaced font will be enough. Sometimes the instructions ask for code changes to be shown as diff listings, and for this it's convenient (even if not required) to use version control software. I habitually use Mercurial rather than Git for reasons I've explained elsewhere, but Git can provide listings in an identical format. To get the printed form shown in the sample reports, where changes are highlighted in bold, I used enscript with the command line

enscript -Ediffu -o - diffs >diffs.ps

followed by ps2pdf diffs.ps >diffs.pdf to convert enscript's Postscript output to PDF, and pdfunite to join the result with the main report.

Some specific recommendations that come from the author's experience in marking assignments:

  • The marker may want to print your report for marking. Please make it easy by formatting your report in black and white, and not using elements such as hyperlinks in a way that is necessary for understanding.
  • Use page numbers, and put your candidate number in the header or footer of the page. This makes it much easier for the marker to keep the pages straight after printing a whole pile of reports for marking.
  • Use a spell checker before submitting your report. Your spelling may be above reproach, but we can all make typing mistakes, and they do create a poor impression.
  • When quoting fragments of code, try to do it by pasting them as fragments of text, not as screenshots. If you must use screenshots, then at least make the background white and the text dark, so that they are still readable when printed.