CS 107 Compilers (Spring 2026)
Quick links
• Projects
• Piazza
• Scala 3 Book
• X86 Cheat Sheet
1 Description
This site is still under construction.
Translation and implementation of programming languages. Topics include parsing, type checking, intermediate representations, code generation, optimization, runtime system, and garbage collection. Compiler design projects for modern imperative and functional programming languages are used to illustrate the concepts and methods.
Instructor: Guannan Wei (guannan.wei@tufts.edu), Assistant Professor in Computer Science
Course URL: https://continuation.passing.style/teaching/cs107-spring26
Piazza: https://piazza.com/tufts/spring2026/cs107/home
Credits: 4 credits
Prerequisite: CS105 and CS40.
Time and Where: Tuesday and Thursday 4:30-5:45 pm, JCC 140
Office hours: TBD
2 Topics and Format
This course covers the theory and practice of programming language interpretation, compilation, and run-time systems, structured around several hands-on projects that builds a compiler for a simple but expressive programming language.
You will build compilers (almost) from scratch, generating x86-64 assembly code. The language features include: arithmetic expressions, arrays, conditionals, while loops, mutable variables, first-class functions and recursion. You will build parser, type checker, intermediate representation, code generator, and runtime system.
Advanced topics such as intermediate representations, continuation-passing style (CPS) transformation, closure conversion, optimization, register allocation, and garbage collection will be covered by the lectures and projects as well.
Attendance is encouraged but not required.
3 Grading
Final grades will be assigned according to the following breakdown:
Project: 30%.
There will be 7 projects throughout the semester. Tentative breakdown of project weights: 3 + 4 + 5 + 5 + 5 + 4 + 4.Midterm: 30%.
Final: 40%.
- Extra credits:
Piazza participation is encouraged. Recognition for active participation and instructor-endorsed answers on Piazza: up to 10%.
Project extra credits: up to 5%.
You need to achieve a minimum of 25% in each of the three components (projects, midterm, final) for a passing grade. Failing to meet this requirement will result in an automatic failing grade for the course.
Late Submission Policy: Projects are due at 11:59pm on the due date. Succeeding projects build upon previous ones and will reveal solutions of preceding projects, so late submissions will not be accepted. Submitted after the deadline will receive 0 points.
4 Resources
The Scala 3 Book: We will use Scala 3 to build compilers, so you need to be comfortable with programming in Scala to complete the projects. This document surveys the basic language features.
X86 Cheat Sheet: In the projects, your compiler will generate x86-64 assembly code, so you need to be familiar with x86-64 assembly to understand what to be generated.
5 Schedule
Tentative schedule for the course:
Week |
| Date |
| Topic |
Week 1 |
| Jan 13, Tue |
| No Class |
| Jan 15, Thu |
| Lecture 1 | |
| Jan 15, Thu |
| Project 1 Release | |
Week 2 |
| Jan 20, Tue |
| |
| Jan 22, Thu |
| ||
| Jan 22, Thu |
|
| |
Week 3 |
| Jan 27, Tue |
| |
| Jan 29, Thu |
| ||
Week 4 |
| Feb 3, Tue |
| |
| Feb 3, Tue |
|
| |
| Feb 5, Thu |
| ||
Week 5 |
| Feb 10, Tue |
| |
| Feb 12, Thu |
| ||
Week 6 |
| Feb 17, Tue |
| |
| Feb 19, Thu |
| ||
| Feb 19, Thu |
|
| |
Week 7 |
| Feb 24, Tue |
| |
| Feb 26, Thu |
| ||
Week 8 |
| Mar 3, Tue |
| |
| Mar 5, Thu |
| ||
| Mar 5, Thu |
|
| |
Week 9 |
| Mar 10, Tue |
| |
| Mar 12, Thu |
| ||
Week 10 |
| Mar 17, Tue |
| No Class. Spring Recess. |
| Mar 19, Thu |
| No Class. Spring Recess. | |
Week 11 |
| Mar 24, Tue |
| |
| Mar 26, Thu |
| ||
| Mar 26, Thu |
|
| |
Week 12 |
| Mar 31, Tue |
| |
| Apr 2, Thu |
| ||
Week 13 |
| Apr 7, Tue |
| |
| Apr 9, Thu |
| ||
| Apr 9, Thu |
|
| |
Week 14 |
| Apr 14, Tue |
| |
| Apr 16, Thu |
| ||
Week 15 |
| Apr 21, Tue |
| |
| Apr 23, Thu |
| ||
| Apr 23, Thu |
|
|
6 Acknowledgments
Parts of the class are based on the Compiler class taught by Tiark Rompf at Purdue and the Advanced Compiler Construction class taught by Michel Schinz at EPFL.
7 Academic Integrity, Plagiarism, and Student Support
Academic Integrity Policy: Tufts holds its students strictly accountable for adherence to academic integrity. The consequences for violations can be severe. It is critical that you understand the requirements of ethical behavior and academic work as described in Tufts’ Academic Integrity handbook. If you ever have a question about the expectations concerning a particular assignment or project in this course, be sure to ask me for clarification. The Faculty of the School of Arts and Sciences and the School of Engineering are required to report suspected cases of academic integrity violations to the Dean of Student Affairs Office. If I suspect that you have cheated or plagiarized, I must report the situation to the Office of Community Standards.
Plagiarism Detection: As part of this course, I will use TurnItIn to help determine the originality of your work. TurnItIn is an automated system which instructors can use to quickly and easily compare each student’s assignment with billions of websites, as well as an enormous database of student papers that grows with each submission. When papers are submitted to TurnItIn, the service will retain a copy of the submitted work in the TurnItIn database for the sole purpose of detecting plagiarism in future submitted works. Students retain copyright on their original course work.
I may also use Language Learning Model (LLM, e.g. ChatGPT, Gemini, etc.) and/or LLM detection tools to evaluate the originality of your work. LLM detection tools attempt to assess if submitted content was potentially created by an LLM platform through the analysis of linguistic patterns and statistical properties of the content. While students retain copyright on their original course work, LLMs and LLM detection platforms may absorb the content as part of their functionality. Please note that while LLM detections may suggest a potential probability that a percentage of the work was generated by an LLM site, it does NOT confirm that there was a violation of the Academic Misconduct policy. This probability may, however, initiate inquiry from your instructor regarding how the assignment was completed.
Accommodations for Students with Disabilities: Tufts is committed to providing equal access and support to all qualified students through the provision of reasonable accommodations. If you have a disability that requires reasonable accommodations, contact the StAAR Center at StaarCenter@tufts.edu or 617-627-4539. Please be aware that accommodations cannot be enacted retroactively, making timeliness a critical aspect for their provision.
Student Support, including Mental Health: As a student, there may be times when personal stressors or difficulties interfere with your academic performance or well-being. The Dean of Student Affairs Office offers support and care to undergraduates and graduate students who are experiencing difficulties, and can also aid faculty in their work with students. In addition, through Tufts’ Counseling and Mental Health Service (CMHS) students can access mental health support 24/7, and they can provide information on additional resources. CMHS also provides confidential consultation, brief counseling, and urgent care at no cost for all Tufts undergraduates as well as for graduate students who have paid the student health fee. To make an appointment, call 617-627-3360. Please visit the CMHS website: http://go.tufts.edu/Counseling to learn more about their services and resources.