CS 426: Compiler Construction
Fall 2021
09:30 - 10:45AM Mondays and Wednesdays, 1304 Siebel Center
Course Number 43355 (3 hours) / 43356 (4 hours)
Teaching Staff
COVID-19 Guidelines
- All students are required to follow the University's COVID-19 guidelines. In particular,
- Everyone (faculty, staff, students, visitors) is required to wear a face covering in university facilities.
- All students, faculty and staff who are not able to be vaccinated for COVID-19 are required to participate in the university's on-campus testing program.
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 code for assignments.
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
Lecture Notes
- 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.
- 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.
- 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 graded separately from undergraduate students.
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
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 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.
Lateness
- Late programming assignments will be penalized 2 points 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 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!