GA2130 Compiler Construction GA2130 Syllabus
Overview
Compilers are a fundamental piece of software infrastructure. They enable programmers to write programs in high-level programming languages and obtain efficient, executable code that can run on a variety of hardware platforms. This course covers the design and implementation of compilers. We will see how to structure compilers as a series of discrete, well-defined transformations between different representations of programs. Throughout the course of the semester, students will implement a complete compiler for a small yet powerful typed, functional programming language.
Grades and Assessment
Grades will be determined entirely on the basis of homework assignments in which students implement the compiler for the course. Given their varying complexity and difficulty, some assignments affect the overall score in the course more than others. In particular, each assignment will be weighted with an assigned number of points. A student’s overall “raw” score for the course will be the sum total of all points from the assignments. There is no pre-determined scale for converting the raw score into a letter grade.
The tentative list of assignments is as follows:
0. OCaml warm-up (6 pts)
1. MIPS Simulator (6 pts)
2. Fortran-ish → MIPS (12 pts)
3. C-ish → MIPS (8 pts)
4. Scheme-ish → C-ish (10 pts)
5. ML-ish → Scheme-ish (10 pts)
6. Optimization (10 pts)
7. Control-flow Graph Analysis (15 pts)
8. Register Allocator (10 pts)
Late Assignment Policy
Assignments submitted after their deadline are considered late. Late assignments are treated as follows. Students may take up to 3 “no questions asked” late days throughout the semester. Each late day used grants a 24 hour extension. Each late day used must be used in its entirety (e.g. you cannot use “half” a late day to get a 24 extension). You may use multiple late days on a single assignment. You must notify the instructor that you are using a late day. If a student has no remaining late days, a late assignment will only be accepted under extenuating circumstances: illness, death in the family, etc. Please let me know if such circumstances arise. Otherwise, the late assignment will receive 0 credit.
Textbook and Resources
There is no official or required textbook for the course. The book that most closely follows what we are doing is Modern Compiler Implementation in ML by . (Note: there are several textbooks by with a similar name that vary in terms of what language the example compiler is implemented in. You want the “in ML” version as Standard ML is closest to OCaml, the language we are using).
Accommodations
Students who have a disability that requires accommodations must inform the instructor that they require such accommodations as soon as possible. Please submit documentation through the for Student Accessibility (CSA). You can learn more about NYU’s accessibility accommodations policy on the CSA website: https://www.nyu.edu/students/communities-and-groups/student-accessibility.html
Academic Integrity and Collaboration Policy
The instructor, the CS department, and NYU as a whole take academic integrity seriously. Please read the Academic Integrity policy on the CS department website: https://cs.nyu.edu/home/undergrad/policy.html
More specifically, for this course, you may NOT collaborate on assignments. You are free to talk at a high level with fellow students about lecture material discussed in the course and how that material might be relevant to a given assignment. But you may NOT exchange or share code with fellow students, nor look at or seek help with such assignments on the internet or other sources.
For example, in this course we will describe various data structures and algorithms used as part of compilation. It would be OK to ask a fellow student for help understanding how such an algorithm works or if there are corner cases/details you did not understand so that you can go about implementing the algorithm yourself. However, the discussion should be restricted to high level “white board” discussion: drawing a figure, explaining a lecture slide, etc. Things that are not appropriate would be sharing a code snippet to implement the data structure, asking a fellow student to diagnose a compiler error or debug your code, etc.
Acknowledgments
This course and its materials are based on course materials developed by , Jean- , and . The instructor is grateful for their permission to these resources.