CSE 40243/60243 - Compilers and Language Design
University of Notre Dame
Fall 2020
Prof. Douglas Thain (dthain@nd.edu)

Overview

This class will introduce you to the theory and practice of compilers. Over the course of the semester, you will construct a working compiler that transforms a C-like language into working assembly code. This project will proceed in five steps, requiring the construction of a scanner, parser, printer, type checker, and code generator. More theoretical topics will be explored in lectures and written assignments and evaluated in exams.

This will be a fun and challenging course for advanced undergraduates as well as graduate students. Compilers cover a broad array of topics in computer science, ranging from the abstract theory of automata to the very practical details of assembly languages. In addition, you should gain some substantial skills:

Graduate students taking 60243 will attend the same class but will have some additional work to earn graduate credit, including an expository paper and a substantial extension to the project compiler.

Course Web Page:

Online Textbook

Suggested References

Course Goals

  1. Discuss the role and limitations of the compiler in a computer system. (Midterm and Final Exams)
  2. Create and analyze finite state automata for lexical analysis. (Scanner, Midterm Exam, Homework 1)
  3. Create and analyze parsing algorithms for common catetgories of grammars. (Parser, Midterm Exam, Homework 2)
  4. Apply type theory to find bugs in compiled programs. (Typechecker, Final Exam)
  5. Create and analyze direct and pattern-matching code generators. (Code Generator, Final Exam)
  6. Understand and apply basic optimization techniques. (Final)
  7. Employ standard tools to create compiler components. (Overall Project)
  8. Construct a complete working compiler for a small language. (Overall Project)

How to Get the Most Out of Class

To succeed in the class, you should attend all class meetings, take notes, and participate in class discussions. During most class sessions, I'll give a prepared lecture for about 30 minutes, and then we will shift into Q&A or working on an example.

The textbook is dense in places; sometimes a key algorithm may only occupy two pages in the book, but requires 30 minutes of class discussion to work out all the details. So, it works best if you read the textbook for a broad understanding before class, and then go back and review details and work some examples afterward.

Because much of the class material involves working with data structures and examples of algorithms, I will mostly work on the blackboard instead of presenting slide decks. I recommend that you take notes by sketching along with pen and paper: the simple act of note-taking exercises your mental muscles in a way that passive observation does not. If you prefer to take notes on your laptop or tablet, then that's fine too.

However, I do ask that you refrain from using your laptops or phones for non-class related tasks during class time. I know it is tempting during a brief lull to respond to messages, check the news, etc, but even one laptop open can be an unavoidable distraction for other people in the class. Let's reserve this time for working together.

If you are connecting remotely via Zoom, you will be expected to be a part of the discussion and working of examples, so please have your camera on and microphone at the ready.

Communications

Assignments and the course schedule are available on the course website, and assignment grades will be posted in Sakai.

Lectures will be recorded and posted on Sakai/Panopto for the benefit of those who couldn't attend, or would like to review prior material. We will be using Piazza to handle general Q&A for the class. If you have a technical question that could be of interest to others, please post it on Piazza, so that others can benefit from the answers. You are welcome to post (or answer) questions anytime, and we will generally monitor and answer questions on weekday afternoons. (Please keep in mind that we do go home at night, and so late-night questions will get answered the next day.)

For questions about grades or anything else that just applies specifically to you, just email the instructor or TA directly.

Office hours will generally be handled via Zoom -- please dial in if are a great time to get focused help on a tricky bit of code or homework problem. General discussion will be handled in a group room, but please ask for a break-out room if you need to have an individual discussion.

Grading Policies

Paper assignments should be brought to class and are due at the beginning of class on the date due. Programming assignments must be submitted electronically before 5PM on the date due.

Late assignments will receive no credit. You are free to turn in programming assignments multiple times before the deadline expires, so it would be a good habit to turn in your partial work on a daily basis, so as to ensure something is submitted.

Exceptions will only be made for serious circumstances such as an extended illness, death in the family, mandatory participation in a university sponsored event, or the other items outlined in section 3.1 of the Undergraduate Academic Code. In those cases, please confer with the instructor at the earliest possibility, and we will make alternate arrangements.

For each assignment, a numeric grade will be awarded. Throughout the semester, grades and class averages will be posted through Sakai. At the end of the semester, I'll convert number grades to letter grades on a scale of A/B/C/D = 90/80/70/65, and exercise some prudential judgement for pluses and minuses and borderline grades.

If you believe that an error has been made in grading an item, please bring it to the attention of the person who graded it (usually the TA) within seven days. Mistakes do occasionally happen in grading, so factual and clerical errors will be cheerfully corrected. Matters of judgement are reserved to the grade. If, after talking to the grader, you are unconvinced, you can bring it up with Prof. Thain.

For undergraduate students in CSE 40243, grades are weighted as follows: Homeworks 15%, Project 55%, Exam I 15%, Exam II 15%.

For graduate students in CSE 60243, grades are weighted as follows: Homeworks 10%, Project 40%, Paper 10%, Extension 10%, Exam I 15%, Exam II 15%.

Diversity and Inclusion

The University of Notre Dame is committed to social justice and diversity. I share that commitment and strive to maintain a positive learning environment based on open communication, mutual respect, and non-discrimination. In this class we will not discriminate on the basis of race, sex, age, economic class, disability, veteran status, religion, sexual orientation, color or national origin. Any suggestions as to how to further such a positive and open environment will be appreciated and given serious consideration.

Academic Code of Honor

As a student at Notre Dame, you are bound by the Academic Code of Honor (http://honorcode.nd.edu), which states:
As a member of the Notre Dame community, I acknowledge that it is my responsibility to learn and abide by principles of intellectual honesty and academic integrity, and therefore I will not participate in or tolerate academic dishonesty.

The purpose of the homeworks and assignments in this course is for each student to gain the discipline and skills in analysis, design, and programming so that they will be able to work independently in a professional setting.

To that end, all exams, homeworks, and programming assignments are to be completed individually. Each student must write their own code from scratch with their own hands based on their own understanding of the course material.

Some Campus Resources