Instructor: Prof. Seth Fogarty Email: sfogarty@trinity.edu
Office: CSI 270M, office hours posted on webpage Classroom: CSI 388
Lecture: TuTh 2:10-3:25 Lab: M 3:55-5:10
Workspace: Join via Github Classroom (repository) Mailing List: Link to join
Textbook: Engineering a Compiler, 2nd Edition by Keith D. Cooper & Linda Torczon (optional)
This is a systems course for computer science majors, designed for to introduce students to the practical issues that arise in compiling. Topics include parsing, syntactic analysis, intermediate representations, and the basics of code optimization.
Reasonable Solutions: Compilers frequently encounters NP-hard optimization problems that must be solved in low-order polynomial time. Algorithms must be correct in all cases and produce effective solutions.
Low-Level Programming: A great deal of computer science is about abstracting away the details of a system. By contrast, in this course students will solve difficult problems using C in order to expose the underlying complexity of the solution. Similarly, by focusing on assembly code as an object language, students will confront the reality of performing computation.
Applications of Theory: Compilers demonstrate the application of theory to practical problems: automata, greedy algorithms, and graph theory all play a role.
This course meets two times a week for lectures and activities covering topics in compiler construction, and once a week for a programming laboratory covering low-level programming and compiler implementation. Most significantly, there is a semester-long project, implementing three major components of an assembly-to-assembly compiler.
This course follows the ungrading practice: there are no exams or quizzes, and instructor inspection of work focuses on design discussion and checkpoint review, not summative assessment. Grades are derived from each student’s self-evaluation and holistic reflection upon what they have learned and accomplished. There are five categories of work in the course:
Time in the course lab is spent on a mix of collaborative labs and peer/instructor-supported project design. The first three weeks of the course lab will cover C programming, program structure and linking, memory allocation, and command-line applications. Each project component has corresponding time in the lab for discussion of algorithmic details, design decisions, and implementation choices. Dovetailing with these implementation labs are three lab assignments: a toy command-line application, an LL(1) table generator, and an exploration of reverse compilation.
Over the course of the semester each student will implement components of an assembly-to-assembly compiler: including a hand-coded scanner and parser, a register allocator, and an instruction scheduler. These project components represent deep investigations into specific components of a compiler, and should not be underestimated. Reflections are required for all components, and a report is required for the register allocator.
Once the projects begin, we will have a weekly virtual standup. This is a form you complete where you state what you’ve accomplished that week, and what is blocking your progress (if anything).
Most theoretical topics will have an in-class exercise. These serve as an important primer for lab assignments and project components, as well as a concrete exploration of topics not covered by the programming component of the course.
Certain course topics will not be explored by laboratory assignments or project components. Assessments for these topics are released, which include further resources for study, questions to evaluate student understanding, and a reflection. Students who are not confident in their understanding of a topic are encouraged to independently create additional resources on the topic and share them with the course.
At least once during the semester, each student is expected to delve into a topic relevant to compilers on their own. This may be writing a summary of a related topics, developing and writing up an example to explain a concept, or bringing in appropriate knowledge from other courses. These delves will be summarized in a small artifact, roughly equivalent to a 400 word report, and a 5-10 minute "babble" - a short presentation, demo, or activity to be given during the final exam slot.
Grades in the course will be primarily based on guided self-evaluation, although I reserve the right to modify the grade if I feel it is necessary. Roughly half of the final grade is based on the project components, while the other half is based on lab assignments and topic assessments The following are expectations for the different grade marks:
A - Complete all components of the project with minimal bugs. Contribute meaningfully to lab design discussions, and be an engaged group member when completing lab assignments. Either demonstrate mastery of material in each topic assessment or create useful resources to shore up understanding.
B - Finish most of all three components of the project, but some features may be buggy or missing (e.g. allocator optimizations or the final scheduler output). Contribute in good-faith during lab design discussions and assignments, but some assignments may not be fully understood or fully functioning. Able to solve most of the problems in all topic assessments, and review areas where understanding was lacking.
C - Complete the first two components of the project, at least through the naïve allocator. Contribute to lab design discussions, but assignments are significantly incomplete. Struggle to complete the topic assessments, and still uncertain how to approach them.
D - Engaged with the course for the entire semester.
F - Failed to significantly engage with the course.
The intention of this grading format is to reduce anxiety, not increase it. If that turns out not to be the case, please talk to me.
Students are expected to abide by the Trinity University Honor code. The collaboration policy for each type of assignment is laid out here:
Labs and activities are fully collaborative, and all collaboration is allowed.
Collaboration on the Project Components is allowed, and the projects may be pair-programmed and submitted together. All code for project components must be written by the student(s) submitting that assignment, and students are expected to be actively involved in implementing all parts of the project components.
Self-Assessments should be attempted alone first, but may be completed with assistance from other students if noted in the reflection.
The Delve and it's related deliverables should be primarily authored by the student, but all resources (including other students) may be consulted.
The use of large-language models (LLMs) is considered analogous to pair programming. Thus, you are allowed to use these tools, but must fully cite the tool. This requires a mention in the README.md file, and that all code written with the assistance of the LLM tool has a corresponding comment in the source code.
Students are expected to attend class regularly. Students who will miss class should contact me before their absence.
In line with the Trinity University policy on equal access and equal opportunity, this course will be made accessible to all students. Any student who feels they may need accommodations based on the impact of a disability or long illness should contact me and the office of Student Accessibility Services to discuss your specific needs.
As a faculty member, I am designated as a Responsible Employee. As such, I am required to report any instances of sexual misconduct or sexual harassment to the Title IX Coordinator. If you share information with me that implicates sexual misconduct or harassment, I am required to report this to the Title IX Coordinator. The purpose of this report is to ensure you have information about support resources and complaint resolution options. My report will not initiate the complaint process, and you are in control over how you choose to engage with our Title IX Coordinator
Please be aware that all classroom instruction, including student participation in classroom activities, is subject to recording and dissemination on secure systems. The recordings will only be available only to students enrolled in the course, or to other CSCI faculty for course review, without explicit consent of everyone in the recording.
This course is heavily influenced by Dr. Cooper's course at Rice University.