CS426: Compiler Construction
12:30-1:45 Tuesdays and Thursdays, 1302 SC
- Teaching Assistant: Alexander Altman
Office: 0207 SC
Office Hours: Wednesdays and Fridays 2pm--3pm or by appointment
- The purpose of this class is to examine the design and implementation of an optimizing compiler. Students will learn about common optimizations, intermediate languages, and design choices in the lectures and will learn about the programming and software engineering challenges of implementing a compiler for an imperative, object-oriented language in machine problems.
- Students will complete two homeworks and four machine problems throughout the course. There will also be a midterm and a final exam. Each machine problem will build on the previous one, so it is expected that students will write well-tested, maintainable code for assignments.
Either of the following books provides good coverage of many topics in the course.
- Engineering a Compiler by Cooper and Torczon, published by Morgan Kaufman. Copies of this book are on reserve at Grainger Engineering Library.
- Compilers - Principles, Techniques, and Tools (2nd Edition) by Aho, Lam, Sethi, and Ullman, published by Addison-Wesley. This is the well known "dragon book." Please note that we are using the recently released second edition of the book. The first edition is out of date. Copies of this book are on reserve at Grainger Engineering Library.
- Advanced Compiler Design and Implementation by Steven S. Muchnick, published by Morgan Kaufmann. This book provides detailed descriptions of many analysis and optimization passes, and some useful case studies of real-world compilers. Copies of this book are on reserve at Grainger Engineering Library. If you happen to buy this book, try to get the latest printing, since it has the fewest errors.
- One or more selected papers. These will be available via the Papers link at the left.
- For questions to the instructors and discussions among students we have set up a forum on Piazza. This is an external website not affiliated with the University of Illinois.
- NOTE: No solutions or code should be posted by students on Piazza. Only the instructors may post solutions or hints.
- Copies of the slides used in class will be posted on the course Web page before each class. This way, you do not need to copy down material on the slides. Nevertheless, you should take detailed notes during the lectures.
ONE MORE TIME! The slides are generally sparse, containing only brief bullets on key points. For example, they are insufficient for studying for exams. This is why you should be sure to take notes during the lectures.
Homeworks and Exams
- There will be two homeworks and two exams, spaced out over the course of the semester. The midterm exam will be in class. The final exam will be at the normal time scheduled by the University for our class slot.
- This class has a semester project divided into four MPs. Graduate students who are taking the course for 4 credit hours (aka 1-unit students) will be required to do a fifth and more substantial part during roughly the second half of the semester. The broad goals for the project are described on the course project page.
||UG or 0.75 unit grads
Homework grading:The two homeworks are worth 5% each. The entire 5% will be given to any homework that is completed and turned in (on time; usual late penalties apply). 0% will be given to any homework that is incomplete or not turned in. The purpose of the homeworks is to give you an opportunity to practice applying the concepts and techniques you learn in class because practice is by far the best way to learn new concepts. Making mistakes on homeworks is not itself a bad thing -- it is a part of learning -- and I see little value in penalizing them. This grading policy is designed to encourage you to practice solving the homework problems without penalizing you for mistakes. Learning from your msitakes is of course crucial, and you can -- and should -- do that by comparing your solutions carefully to the official solutions we hand out to you.
Project grading: The project will be due in four parts, and will be graded as the semester progresses. For 1-unit students, the total score for the semester will be computed by scaling all the basic course components by 0.8, and giving the unit project a weighting of 0.2, i.e.,
Total = 0.8 * BasicTotal + 0.2 * UnitProjectScore
Grad students vs. undergrads: Graduate students will be graded separately from undergraduate students.
- We will use the EWS machines for the programming projects. See the EWS web site for more information.
- All students should automatically have accounts assigned. You are responsible for getting your own passwords and making sure you can access the account in the first week of classes.
- If you choose to use your own machine for the programming projects, you are responsible for testing your solutions on the EWS machines before submission. All projects will be graded on EWS.
Course Policies on Incomplete MPs, Lateness and Cheating
- INCOMPLETE MPs: All the MPs after the first one are dependent on the previous ones. If you could not get a previous MP working and don't want to finish it before you start on the next one, then you can get the previous MP solution from the TA but with a penalty of 10% on the next one. For example, in MP3 you are supposed to use your MP2 solution and if you could not get MP2 working before starting on MP3, you can get our code for MP2 from the TA, but you will be penalized 10% on MP3. Though this means you will be penalized twice for not finishing an MP, an important aspect of this project is building a working compiler, not just building a piece, then throwing it away before building the next one.
- LATE SUBMISSIONS: Late submissions of homeworks or programming assignments will be penalized 1 point per hour late (or fraction thereof), counted from 5pm on the due date. This means being several hours late could affect your grade.
There are two circumstances for which we'll give "free" extensions:
- Serious personal problems. These will be dealt with individually. They are typically either serious illness to you (doctor's verification required) or a major family emergency.
- Extended lab downtime. This is extremely rare. A whole day of downtime in the lab might qualify. Minor downtime does not qualify. "Flakiness all weekend" does not qualify. Accidental loss of files does not qualify. If you have chosen to work on some other machine other than the designated class machines, then you do so at your own risk. To protect yourself, keep recent backups on the class machines so that if your machine breaks, you can recover.
CHEATING: You are NOT to copy solutions from ANY source (including, but not limited to, books, people, old class notes or handouts). While the pressures of many classes, homeworks, work and/or extracurricular activities can be great, this is never an excuse for copying solutions from others. "Helping" somebody by allowing them to "borrow" your homework is not doing them a favor either, but indicates your approval and active participation in such activities. Refer to the Campus Code regarding academic integrity. A first offense will result in a zero on the assignment or exam, as well as reducing the overall course grade by a whole letter grade. If you are aware of any breach of academic integrity, it is your responsibility to report it to the instructor.
Discussing your problems with other students, however, is encouraged and even highly recommended. This means asking someone to look at parts of your code to give you advice, asking them for suggestions when you face an obstacle, working out example exercises together that are not on an assigned homework, or just discussing any aspect of the material. What you may not do is to copy or in any way use code or homework solutions written by anyone else or dictated by anyone else. As responsible adults, you can draw the distinction between cheating and honest behavior: exercise your judgement and try to preserve the highest level of professional integrity in everything you do.
Bottom line: You may discuss difficulties with others and get occasional help with debugging but you must write your code entirely by yourself.
How to Get the Most out of this Course
- Read the text as it is quite thorough, with many examples worked out, good motivating discussions, and useful intuition.
- Participate actively in class: ask questions when you don't understand something, and share in the in-class exercises.
- Do the homeworks and project assignments ahead of time whenever possible. Working madly to beat a deadline is a terrible way to learn!