CSE 401/M501 24au Introduction to Compiler Construction
Information and Syllabus

Logistics and Contact Information: See the main course web site www.cs.washington.edu/401/. Look there for information about the course including meeting times, staff, office hours, communications, etc.

Catalog Description: Fundamentals of compilers and interpreters; symbol tables, lexical analysis, syntax analysis, semantic analysis, code generation, and optimization for general purpose programming languages. No credit to students who have taken CSE 413. Credits: 4.

Prerequisites: The official prerequisites are CSE 332 (data abstractions) and CSE 351 (hardware/software interface). That also implies CSE 311, which is a prerequisite for CSE 332. Although not formally required, background from CSE 331 (software design & implementation) is useful for any large project, including the one in this course.

Texts: There are currently four good textbooks for introductory compiler courses. The book by Cooper & Torczon is the primary text for the course since it seems to be the best overall match, and all of the assigned readings will come from it. It is the only one that you really need for the course. The Appel book is the original source of the minijava project, although some details of our version will be different. The Fischer, Cytron & Leblanc book is very close in structure to what we're doing. The Dragon Book (Aho, et al.) is a classic.

The 2nd edition of the Cooper/Torczon book (at least) is available through Safari Books Online, and UW students have free access to all Safari books through the UW libraries. Go to https://www.oreilly.com/online-learning/, click sign-in at the top right, and sign in with your netid@uw.edu email address to access them.

Primary text: Engineering a Compiler, Cooper & Torczon, 2nd ed. M-K 2012, 3rd ed. 2022. errata and links. The third edition has useful updates, but for much of what we need either the second or third edition should be suitable for this quarter.
Also useful: Modern Compiler Implementation in Java, Appel, Cambridge, 2nd ed, 2002.
Also useful: Compilers: Principles, Techniques, & Tools, Aho, Lam, Sethi & Ullman, A-W, 2nd ed, 2007.
Also useful: Crafting a Compiler, Fischer, Cytron, and LeBlanc, A-W, 2010.

Grading and Exams: The course will include written assignments, a multi-part compiler project, and midterm and final exams. Exams are intended to provide the opportunity to review and internalize course material, so they do not weigh as heavily as they might have done in more traditional courses. Tentative weights are:

We reserve the right to make reasonable adjustments to these weights as the quarter evolves.

The course project involves building a real compiler for a core subset of Java. Projects will be done in groups of two. Ultimately what matters is where you and your partner wind up, but there will be intermediate milestones due every couple of weeks to keep everyone on schedule and to provide feedback at important points. The final project and each milestone will be graded on correctness, code quality (style), and testing quality and completeness. The final project grade (where you wind up) will count for roughly half of the overall project grade, with the quality and timeliness of the intermediate deadlines counting for the other half.

Students enrolled in CSE M 501 will also work on projects in pairs, but will be expected to add some extensions to their compiler beyond the basic CSE 401 project or do additional work (readings, papers, etc.) to be discussed with the instructor. If you are enrolled in CSE M 501, you should pair up with another student who is also enrolled in that course, or discuss the situation with the instructor. If a CSE M 501 and a CSE 401 student want to work together, it usually is best for the CSE 401 student to change their registration to CSE M 501 so both students have the same course requirements. Again, if this affects you, please discuss it with the instructor. Further details about the project will be provided later.

Homework assignments are to be done individually.

Extra credit may be available on some assignments. It is designed to have little (but some) impact on your grade if you do it. Not doing extra-credit work will not lower your grade - regardless of how many other students attempt it. Extra credit is designed to be challenging and an opportunity for people with available time or interest to explore further. Therefore, you can expect any extra-credit work to count for much less than it should based on how difficult it is or how much time you spend on it. You should not attempt any extra-credit work until the basic part of an assignment is done. Extra-credit work will not be awarded credit unless the required work is "almost perfect" otherwise.

If you discover an error in grading, please bring it to our attention within one week after the assignment or project is first returned.

Late Policy: Work is due at the time given on the assignment. It is exceedingly unlikely that skipping class to finish homework is in your interest. For the entire quarter, you may have four “late days” on individual homework assignments. You are strongly advised to save them for emergencies. You may not use more than two for the same assignment. Similarly, for group projects (the compiler) your group has four late days for the entire quarter, and your group may not use more than two of them on any single project part. Late days must be used in 24-hour (integer) chunks. Assignments submitted after all late days have been used will not be accepted for credit. Some assignments may have more restrictive late day policies in order to make sample solutions available or to allow for discussion in class or sections right before exams, or at the end of the quarter when work needs to be finished. You should not plan in advance to use late days on assignments or projects. They are intended to allow for unexpected situations where an extra 24- or 48-hours to finish an assignment suddenly becomes necessary. This policy may not be the same as in other classes. You are responsible for understanding it if you choose to submit late work.

While we are still dealing with some lingering effects of the pandemic and other disruptions from the last few years, at this point we expect that you should normally be able to manage your workload and keep up with the class, baring unexpected emergencies beyond your control. That specifically includes working with your partner on the compiler project and handling your share of the work promptly and professionally. However, if you are having trouble with the course or workload or anything else, please contact the course staff as soon as you can. We will do our best to work with you, but we can be most helpful if you get in touch sooner rather than later. Don't "tough it out" hoping that things might get better, only for the problems to surface late in the quarter when they are much harder to fix. Do not "ghost" your partner. If there are difficulties with the project, communicate with your partner and contact the course staff so we all can figure out how to help.

In case of a true emergency (hospitalization, family emergency, other unforeseen circumstances) where the standard late policy would not make sense, please contact the instructor to discuss the situation as soon as practical.

Incompletes are never given simply because assignments were not done on time.

Accommodations: Please refer to the university policies regarding accommodations and religous accommodations. These policies apply in this class as everywhere else at UW. Please contact the instructor, DRS, or the course staff as needed so we can help.

Academic Integrity: Any attempt to misrepresent the work you submit will be dealt with via the appropriate University mechanisms, and your instructor will make every attempt to ensure that standards are met and any problems are dealt with appropriately. The guidelines for this course and more information about academic integrity are in a separate document. You are responsible for knowing the information in that document.