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.

Spring 2024: TTh 12:30 - 2:00, GDC 5.302 and Zoom, Unique No. 51185.

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

TA:     Trung Dang       mailto:dddtrung@cs.utexas.edu     Office Hours: Monday 1:00 - 2:30, Friday 1:00 -2:30 at GDC 1.302 Desk 1.

Our current plan is to offer the class both in-person in GDC 5.302 and on Zoom. If there is a change in the Covid situation, we will adapt as needed. Protect Texas Together is UT's page for Covid information and links.

Canvas and Ed Discussion

Lectures with drawings

Lecture Notes:     These will be available in printed form from UT Document Solutions in GSB 3.136.
PDF     online by Contents     online by Index

Directory for Program Files     also in /projects/cs375/ on the CS Linux systems.

Testing and Debugging

Using Xpra Remotely

Vocabulary

Clicker Questions with answers are a useful source of multiple-choice questions to study; some of them might appear on an exam.

Midterm Study Guide     Example Midterm Questions     Answers     Midterm Flash Cards

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

Table of Chomsky Language Hierarchy

Microcontrollers and UT Foundry

Updates for Education in Times of Covid

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 or have other problems, contact Student Emergency Services, or studentemergency@austin.utexas.edu or Natural Sciences Emergency & Life Supports.

Students who need accommodations may request them from Disability and Access.

If you become sick or have other problems, be sure to notify the instructor promptly; timely notification is required. Any problems with grading of assignments or exams must be raised within a week of when the grade is posted.

This syllabus is subject to change, and it may be updated during the semester. Be sure to check this page regularly.

We will have an interactive office hour meeting as shown above on Zoom. This meeting is optional, come-and-go as you wish.

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.

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 an in-person class.

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

Assignments

There are due dates shown for each assignment. UT rules prohibit any assignments from being due after the last class day. There will a deadline for turning in all assignments soon after the last class day. 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. Assignments must be turned in within 4 days of the stated due date unless you get prior permission. A late penalty of 10% per day late may be assessed.

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), Ed Discussion (via Canvas), and email consultations when needed.

All programming assignments must be your own individual work. Assignments may be written in C / lex / yacc or in Lisp (only if you are already good at Lisp). Program files are provided, in the directory /projects/cs375/ or in http://www.cs.utexas.edu/users/novak/cs375/ or on the CS Linux systems as /projects/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.

Program Grading

Assignments:

Attendance

Attendance counts as 10% of your grade. Attendance can be in one of two forms (your choice for each lecture):

  1. In Person: Traditional in-person lectures will be held in our classroom. Attendance will be taken by signing the attendance sheet at each lecture.

    I Ask: that those who are not fully vaccinated attend the Zoom version instead.

    ASTM Level 3 masks will be available free at each class.

  2. Zoom: The in-class lectures will be available live on Zoom, so everyone will get the same lectures. Those who attend via Zoom will be able to ask questions, just as those in class can. Zoom keeps attendance, which will be used for the attendance grade. Be sure to login to Zoom using your eid@eid.utexas.edu

Lectures will be recorded by Zoom and can be accessed (with drawings) at Lectures. There is also a recording from the classroom system, available through Canvas.

You can choose whether to attend in person or on Zoom on a day-to-day basis; the attendance scores will be combined. Those who cannot attend at the regular time may watch lectures later than the regular class time by special permission (e.g. for students who are located in China or India). Of course, if you are sick, you should attend via Zoom and not come to campus. If you are in a far-away time zone or must miss class for other reasons, watch the online videos and then email the instructor (once per week) to get attendance credit.

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

ISO 7185 Pascal Standard (pdf)

Microcontrollers (pdf)

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

Quotes from Alan Perlis

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:

Optional 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, March 7, at class time, on Canvas
Final Exam 30% Saturday, May 4, 8:00 - 10:00 AM 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.

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.

Sharing of Course Materials is Prohibited: No materials used in this class, including, but not limited to, lecture hand-outs, videos, assessments (quizzes, exams, papers, projects, homework assignments), in-class materials, review sheets, and additional problem sets, may be shared online or with anyone outside of the class unless you have my explicit, written permission. Unauthorized sharing of materials promotes cheating. It is a violation of the University Student Honor Code and an act of academic dishonesty. We are well aware of the sites used for sharing materials, and any materials found online that are associated with you, or any suspected unauthorized sharing of materials, will be reported to Student Conduct and Academic Integrity in the Office of the Dean of Students. These reports can result in sanctions, including failure in the course.

Gordon S. Novak Jr.