CS 426: Compiler Construction
Fall 2022
12:30 - 01:45PM Wednesdays and Fridays, 1302 Everitt Laboratory
Course Number 43355 (3 hours) / 43356 (4 hours)
Teaching Staff
Instructor:
Vikram Adve
Office: 4235 SC
Phone: 217-244-2016
Email:
vadve@illinois.edu
Office Hours: Wednesday 2-3pm (initially in foyer outside Everitt 1302 and then in my office, Siebel 4235) or by appointment via Piazza private message.
Teaching Assistant: Aaron Councilman
Pronouns: they / them
Email: aaronjc4@illinois.edu
Office Hours: Thursday 3-4pm (Zoom)
Teaching Assistant: Leon Medvinsky
Email: leonkm2@illinois.edu
Office Hours: Monday 3-4pm (Zoom)
Course Assistant: TBA
Statement on CS CARES and CS Values and Code of Conduct
All members of the Illinois Computer Science department - faculty, staff, and students - are expected to adhere to the
CS Values and Code of Conduct. The
CS CARES Committee is available to serve as a resource to help people who are concerned about or experience a potential violation of the Code. If you experience such issues, please
contact the CS CARES Committee. The instructors of this course are also available for issues related to this class.
Course Content
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 lecture and will learn about the software engineering challenges of implementing a compiler for an imperative, object-oriented language in machine problems.
Assignments
Students will complete two homeworks and four machine problems throughout the course, plus a fifth machine problem for students in the 4-hour section (N4). 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 maintainable, reusable, well-documented code for assignments. Information on grading policies can be found
below.
Textbook
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.
You may also find this additional reading useful:
- 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.
Piazza
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.
Lecture Notes
Copies of the slides used in class have been posted on the
course website. If any changes are needed for a topic (which is infrequent), they will be posted at least by 5pm 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.
NOTE: 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 and the date will be announced shortly. The final exam will be at the normal time scheduled by the University for our class slot.
Project Description
This class has a semester project divided into four MPs. Graduate students who are taking the course for 4 credit hours (hereinafter, and without loss of generality, referred to as 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.
Grading Policies
| |
UG or 0.75 unit grads |
1-unit grads |
| MP1-MP4 |
40% |
32% |
| Homeworks |
20% |
16% |
| Midterm Exam |
15% |
12% |
| Final Exam |
25% |
20% |
| Unit Project |
N/A |
20% |
- The core programming project will be due in four parts, and will be graded as the semester progresses.
- For 3-credit-hour students, the project carries 40% of the grade, allocated as: MP1: 6%, MP2: 10%, MP3: 12%, MP4: 12%.
- Only 1-unit (i.e., 4-credit-hour) students must do the unit project, which has a total weighting of 20% of their semester grade.
- For 1-unit students, the total score for the semester can 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
- Graduate students will be assigned final course grades separately from undergraduate students (but all scoring of course components will be common).
Computing Facilities
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.
General Course Policies
Second-chance Submissions:
- For all MPs (except MP1), students may submit a second version of their solution up to one week after the original due date.
- The final score for the MP will be calculated as max(First-Score, 0.9 * Second-Score) - Late-Penalty (where LatePenalty is the late penalty for the first submission, as detailed in the section, Lateness).
- The first submission is required. Another way to put it is that the late penalty will accumulate to 100% within a week, so a lack of a first submission will net you 0 points.
- No late submissions will be accepted for the second submission.
Incomplete MPs
- 10 points are reserved for completely working MPs with no significant errors. So if your MP is not working (with respect to the test files we use), expect to lose 10 points right away.
- Also, all the MPs (except 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 a 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 a 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.
Lateness
- Late programming assignments will be penalized 1% of total available points (e.g., 1 point out of 100) per hour late (or fraction thereof), counted from 5pm on the due date. This means being several hours late could significantly 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 any in 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!