This page last modified: "12.09.06"
CS325 (Compiler Design) is an option for third and fourth year students. The purpose of this note is to help students decide if they want to sit this module and also to help them plan their progress in studying for it once they decide to take it.
This is not an easy option. Some students seem to feel that, because there is no assessed work, they will be able to neglect the module until a few weeks before the exam, when they start to prepare for the exam. However, the module covers a lot of ground, which involves understanding many algorithms, and this requires practice rather than memorisation. I recommend students to plan on investing at least one hour/week outside lectures during term 1 to go over the material. If you cannot do this, it may be difficult to do well in the exam.
The module is open to students from different programmes of study. Computer Science students will have taken the module CS203 (Automata and Formal Languages) which does provide an introduction to compilers. Students from Mathematics and CSE programmes may not have taken this module, and will be at a disadvantage. However, it is possible to get enough background on the topics by consulting the textbook used for CS203, or even other books available at the library.
The book is based around an implementation of a compiler written in Java, thus a facility to understand Java code is required. It may be enough to have a close familiarity with a related language, like C++. Also experience with writing programs - in any language - and compiling programs is very helpful.
There is one main textbook for the module, Andrew Appel's Modern Compiler Implementation in Java. As it is the same book and edition as used last year, you may be able to obtain a copy from students who have taken this module. I expect every student to have access to a copy of the book. When I use figures from the book via the overhead projector, I do not make copies for students, and neither do I allow enough time for students to copy them.
For some parts of the module, I often consult and use other books that cover that particular topic in a better/easier/more complete way. In these cases, I expect students to use the library (such as during the 1 hour/week I recommend above) and prepare their own notes. When I use figures and pseudocode from these other books, I usually announce which book/page they are from, in order that you can look it up later. In 2005, I made extensive use of the Watt and Brown book, and I have asked the library to buy several copies. Early in 2006 I noticed that the classic book by Niklaus Wirth (the inventor of Pascal, and one of my idols) is now available electronically and freely, so I expect to use this book quite extensively.
I do provide basic notes for the module. These are not exact copies of the slides I use: there are also several gaps in the notes, which I expect students to fill in either as homework or during lectures. You could 'cheat' and copy the text from colleagues, but I don't see the point in that: the reason I don't give the answers is to give you space to think and learn, and prepare for the exam. Copying them from elsewhere defeats the purpose. I expect students to annotate the notes during the lectures. I do not print the code and figures from the main textbook, as I assume most students will have access to the book, where they can get a much better copy.
The notes do not provide enough information to make up for an absence from lectures. Please plan to attend all the lectures; through all the years I have taught this module I've noticed a strong correlation between attendance in lectures and performance in the exam.
Recently I have been working on developing an on-line system for receiving constant feedback from the students, on parts of the module that have been taught. The form will work both ways, in the sense that it will allow students to evaluate themselves vis-a-vis the learning outcomes. I expect students to make use of this. Also, proper use of the newsgroup is encouraged.
The exam paper will consist of 6 questions, and you will be expected to answer any 4 of them. All answers will be marked, and the best 4 marks will be considered. However, rather than spreading yourself attempting all questions, I recommend trying to answer a few well, taking your time over them. It is possible to do well in the exam - the average usually falls between 60 and 65 out of a maximum mark of 100, and there are often a handfull of "super-firsts", ie, marks above 85. However, there is usually a long tail, of several people getting marks in their 30's, maybe because of the difficulty of the material as I alluded to above.
I welcome students to come to my office to go over any questions they might have, and will have weekly office hours during the term the module is taught.