CS 375: Compilers


CS 375 covers the design and construction of compilers for programming languages. Each student writes a compiler for most of Pascal; code is generated for a real processor and is run on hardware.

This course has a heavy programming workload. Students planning to take the course in summer should expect to dedicate their lives to this course for five weeks; do not try to work while taking CS 375 in summer unless your boss gives you time off to work on the projects.

Summer 2020: MTWThF 1:00 - 2:30 on Zoom, Unique No. 84910.

Instructor: Gordon S. Novak Jr., GDC 3.824; Office Hours: MTWThF 2:30 - 3:30 PM via Zoom. novak at cs dot utexas dot edu

TA:

Updates for Online Education, Summer 2020

I hope that you and your family and friends are safe and healthy during these troubling times of coronavirus.

If you do not have access to the things you need (housing, food, computer, etc.) to continue your education, the University considers that to be an emergency. If you need resources, please contact Student Emergency Services, or studentemergency@austin.utexas.edu A special fund has been established to provide help to those who need it.

Lectures will be online with Zoom via Canvas at the scheduled class time, MTWThF 1:00 - 2:30 PM. Lectures will be recorded so that you can replay them for review or if you miss the online time. Be sure to upgrade to Zoom 5 and Duo for your laptop and phone before class time.

We will have an interactive office hour meeting each day from 2:30 - 3:30 PM after class. This meeting is optional, come-and-go as you wish.

Lectures will also be indexed, with supplemental images, on this page: Lectures

The class lecture notes are available here: PDF

Please be aware that during the start of online Zoom sessions, your image and anything in the background of your camera view may be recorded and could be visible to others. You should not share the online recordings with people who are not in the class, for copyright and privacy reasons.

Student microphones will be muted during lecture to reduce the background noise level. The Zoom chat room option will allow you to ask questions at any time. We will also have a Piazza page for the class.

Suggestions for improving the lecture and materials will be welcome. Our goal is to give you the same course that you would have gotten in class.

There are due dates shown for each assignment. UT rules prohibit any assignments from being due after the last class day. There will be a deadline of August 14 for turning in all assignments. It is important for you to keep up with the assignments; if you get behind, the result will be that you will not be able to complete all of the assignments, or parts of them. Remember that a partially completed assignment gets a much better grade than no submission.

The assignments will get more interesting for the second half of the semester; the key to making a good grade is to start your assignments early.

We will support you with office hours (both instructor and TA), Piazza, and email consultations when needed.

Zoom records who participates in lectures; this will be used as the attendance grade. Be sure to login to Zoom with your eid@eid.utexas.edu login to get proper attendance credit.

The Final Exam is scheduled for August 17, 9-12 AM, online.

Optional Text: Aho, Lam, Sethi, & Ullman, Compilers: Principles, Techniques, and Tools

We will not be using iClickers this summer, but the Clicker Questions are useful and could occur as exam questions.

Grades on Canvas

Lecture Notes: by Contents or Index or PDF.     Table of Chomsky Language Hierarchy

Vocabulary

Piazza

Programming assignments may be written in C / lex / yacc or in Lisp (if you are already good at Lisp). All programming assignments must be your own individual work. Program files are provided, in the directory /projects/cs375/ or in the FTP directory for Program Files, ftp://ftp.cs.utexas.edu/pub/novak/cs375/ or http://www.cs.utexas.edu/users/novak/cs375/ for use with the assignments. The files are described by Program File Descriptions. It is legal to use any of these files as part of your programs.

Turn in the Programming Assignments through Canvas

Testing and Debugging

Assignments:

X86 References: We use the AT&T / Gnu / GAS Syntax

ISO 7185 Pascal Standard (pdf)

Microcontrollers and UT Foundry

Microcontrollers (pdf)

Song: "God Wrote in Lisp", Lyrics by Bob Kanefsky, sung by Julia Ecklar.

Quotes from Alan Perlis

Program Grading

Midterm Study Guide and Example Midterm Questions and Answers and Midterm Flash Cards

Final Exam Study Guide and Example Final Exam Questions and Answers and Vocabulary Flash Cards

Course Description:

CS 375 covers the design of Compilers, which translate programming languages that are easy for humans to use (Java, C++, etc.) into the difficult-to-understand machine language that is executed by computer hardware. Because machine language is the only language that can actually be executed, the compiler, along with the operating system, is one of the central pieces of systems software that makes computers usable.

This course will cover the full range of compiler topics. Each student will write a real compiler for most of the Pascal programming language, producing machine code that we will run on hardware. This compiler is an excellent capstone project for a degree in Computer Science: it is a large project that produces an industrial-scale software product. Algorithms, Data Structures, Programming Languages, Architecture, and Theory are combined in a compiler, so this course brings together the courses of the undergraduate CS curriculum into a coherent whole.

By the end of the course, the student will have completed a significant rite of passage and have the confidence of having written a major component of systems software.

The course covers the major parts of a compiler, in the order in which they operate in the compiler itself:

Readings in Aho, Lam, Sethi, and Ullman:

Grading Policies:

Grades are kept on Canvas. It is your responsibility to check your grades often to make sure that your assignments have been received and graded.

Course grades are assigned on the scale A = 93-100, A- = 90-93, B+ = 87-90, B = 83-87, B- = 80-83, etc. provided that the Final Exam grade is at least 65; if the Final Exam grade is below 65, a lower course grade may be assigned at the instructor's discretion. Grades are averaged using the following weights:
Midterm Exam 20% Thursday, July 30, 1 PM on Canvas
Final Exam 30% Monday, August 17, 9-12 on Canvas
Lecture Attendance 10%
Programming Assignments:
Lexical Analyzer 06%
Lexical Analyzer using lex 04%
Parser (total of 3 parts) 18%
Code Generator 12%

All students must complete all exams and programming assignments. This course has a very heavy programming load, especially in Summer; students should not take other classes or work while taking CS 375 in Summer.

Programming projects must be your own individual work. Students may discuss concepts or help with specific problems in another student's code. However, sharing code, working together on program design or flowcharts, or reading someone else's code is not allowed. All code that is given in the class directory may be used as part of your programs.

Beware of Github! If you keep your code on Github, be sure to file-protect it; otherwise somebody may copy it and you may get into trouble. Do not even look at someone else's code on Github; those who do are likely to copy it and get caught.

Gordon S. Novak Jr.