Course Syllabus

Syllabus

CS 4470: Compilers

AEB 350, MW 11:50-13:10

(livestreamed and recorded via Zoom)

Instructors

Instructor:

Ben Greenman <blg@cs.utah.edu> MEB 3252

TA:

Bhargav Kulkarni <email TBD> office TBD 

Course Description

Overview

Course CS 4470
Department School of Computing
Credit Hours 3
Semester Spring 2025

Outcomes

  • Understand concepts in lexical analysis, and implement a lexer
  • Understand how a programming language is represented by a grammar
  • Understand LL and LR parsing, and write an LL parser
  • Understand concepts in type checking, and implement a type checker
  • Understand target-independent program optimizations, and implement several relatively simple optimizations
  • Understand code generation, and implement generation of x86-64

Materials

There are no required materials / textbooks.

Optional reading:

Communication

Discord:

Email:

Office Hours

TBD

Evaluation

  • Grades will be assigned on a 90/80/70/60 scale,
    • We reserve the option to curve raw scores before assigning grades if they judge that students’ numeric performance is not representative of the grades they deserve.
  • Grade components
    • 70% programming assignments
    • 20% in-class participation, though presentations and discussions
      • Contact the instructor if in-class participation is a major barrier
    • 10% quizzes, including course evaluations.

There will be no exams. No midterms, no final.

Teaching and Learning Methods

Class time will be used for lecture and discussion. We’ll spend a lot of time looking at compiler code in class: some of it written by students, some by the instructors, and some by compiler developers in industry. Outside of class, most of your time will be spent implementing a compiler for a language called JPL (designed to provide a relevant, challenging, and interesting learning experience). The instructors will provide extensive test cases to guide your journey toward a correct compiler. Writing compiler code is the most effective way to learn about how compilers work.

Students will build a real compiler, in stages, throughout the semester. Subsequent assignments will build upon early ones. Do a good job each week to avoid falling behind.

Course Policies

Late work: Assignments are due weekly at 5pm on Fridays. Late submissions are allowed until the start of class on Monday without penalty. We will not accept submissions after class starts.

Participation: We strongly encourage your participation in both in-class discussions and online forums. The instructor will provide a welcoming environment in which we understand that all code has bugs and the goal is to find more bugs, not to criticize the bugs author.

Online: We will use Canvas, Discord, and GitHub. Online discussion will center on Discord. All programming artifacts will live on GitHub. Canvas will record whatever things must be in Canvas.

Academic Misconduct: We follow the Kahlert School of Computing policy. See below. Academic dishonesty results in a failing grade for the course. Two instances of academic dishonestly lead to expulsion from the major. 

Zoom: Lectures will be streamed on zoom and recordings will be available on Canvas for several weeks. Zoom attendance is allowed but not encouraged. We will not actively monitor the chat. We are unlikely to allow audio from participants (the host machine will probably be muted). The positioning of the recording camera and microphone may be poor. Our goal with the recordings is to allow anyone to catch up with class for any reason it might be necessary (no questions asked), but without detracting from the in-person experience where audio/video choppiness ("oops i was muted", etc, etc.) is much less of a problem.

AI + LLM: You may use AI tools (including but not limited to ChatGPT, GitHub Copilot, Llama, Claude, etc. etc.) for any part of this course. You must cite the AI contributions to your work and you must take full responsibility for the outputs. Failure to do so may result in a zero for the assignment and an academic integrity case. Beware that AI tools may produce wrong and misleading output, and beware that their cost to the environment may not be factored in to their usage price.

Schedule

[2024-12-13: tentative schedule, subject to change]

Week  Monday   Wednesday Homework
1 Intro + JPL Lexing JPL examples
2 ASTs, structural recursion Sequences Lexing
3 Parsing LL(1) vs LR(1) Converting to LR(1) Parsing prefix
4 Precedence / associativity Disambiguation Parsing postfix
5 Types & type rules Typechecking Parsing infix
6 Symbol table & names Resolving types Typing expressions
7 IRs IR Compilation Typing contexts
8 Runtimes Correctness IR expressions
9 Data types Registers & memory IR control flow
10 N/A, happy spring break N/A N/A
11 Object files Linking & loading Assembly
12 Optimization basics Peephole optimization Calling conventions
13 Dataflow analysis: lattices Dataflow analysis: fixpoints Peephole optimization
14 Memory hierarchy Access patterns Constant folding
15 Vectorization: idea Vectorization: masking Loop ordering
16 TBD TBD TBD

Support

Accommodations will be considered on an individual basis and may require documentation.

Please contact the instructor as soon as possible (preferably shortly before the semester begins) to request accommodations of any kind.

Contact your instructor as soon as possible if an extreme personal circumstance
(hospitalization, death of a close relative, natural disaster, etc.) is interfering with your ability to
complete your work.

To request an accommodation for religious practices, contact your instructor at the beginning of the semester.

If you are student on active duty with the military and experience issues that prevent you from participating in the course because of deployment or service responsibilities, contact your instructor as soon as possible to discuss appropriate accommodations.

 

Disability Access

All written information in this course can be made available in an alternative format with prior notification to the Center for Disability Services (CDS). CDS will work with you and the instructor to make arrangements for accommodations. Prior notice is appreciated. To read the full accommodations policy for the University of Utah, please see Section Q of the Instruction & Evaluation regulations.

If you will need accommodations in this class, contact:

Center for Disability Services
801-581-5020
disability.utah.edu
162 Union Building
    200 S. Central Campus Dr.
     Salt Lake City, UT 84112

Office of Equal Opportunity

The Office of Equal Opportunity And Affirmative Action (OEO/AA) is dedicated to providing a fair and equitable environment for all to pursue their academic and professional endeavors and to equally access University programs.

OEA/AA
801-581-8365
oeo.utah.edu
383 South University Street
    Level 1, OEO Suite
    Salt Lake City, UT 84112

Price College Counseling Service

Goal: provide a confidential, safe, and non-judgmental space to address any stressor or concern in your life. Empower you to take actions to meet your needs, values, and goals.

Call to schedule an Initial Consultation (IC) appointment. Be sure to ask for “embedded counseling for College of Engineering”.

Counseling Center
801-581-6826
www.price.utah.edu/students/current/counseling
WEB 1707

University Policies

Americans with Disabilities Act (ADA)

The University of Utah seeks to provide equal access to its programs, services, and activities for people with disabilities.

All written information in this course can be made available in an alternative format with prior notification to the Center for Disability & Access (CDA). CDA will work with you and the instructor to make arrangements for accommodations. Prior notice is appreciated. To read the full accommodations policy for the University of Utah, please see Section Q of the Instruction & Evaluation regulations.

In compliance with ADA requirements, some students may need to record course content. Any recordings of course content are for personal use only, should not be shared, and should never be made publicly available. In addition, recordings must be destroyed at the conclusion of the course.

If you will need accommodations in this class, or for more information about what support they provide, contact:

Center for Disability & Access

  801-581-5020
  disability.utah.eduLinks to an external site.
  162 Union Building
  200 S. Central Campus Dr.
  Salt Lake City, UT 84112

Safety at the U

The University of Utah values the safety of all campus community members. You will receive important emergency alerts and safety messages regarding campus safety via text message. For more safety information and to view available training resources, including helpful videos, visit safeu.utah.edu.

To report suspicious activity or to request a courtesy escort, contact:

Campus Police & Department of Public Safety

  801-585-COPS (801-585-2677)
  dps.utah.edu
  1735 E. S. Campus Dr.
  Salt Lake City, UT 84112

Addressing Sexual Misconduct

Title IX makes it clear that violence and harassment based on sex and gender (which includes sexual orientation and gender identity/expression) is a civil rights offense subject to the same kinds of accountability and the same kinds of support applied to offenses against other protected categories such as race, national origin, color, religion, age, status as a person with a disability, veteran’s status, or genetic information.

If you or someone you know has been harassed or assaulted, you are encouraged to report it to university officials: 

Title IX Coordinator & Office of Equal Opportunity and Affirmative Action

  801-581-8365
  oeo.utah.edu
  135 Park Building
  201 Presidents' Cir.
  Salt Lake City, UT 84112

Office of the Dean of Students

  801-581-7066
  deanofstudents.utah.edu
  270 Union Building
  200 S. Central Campus Dr.
  Salt Lake City, UT 84112

To file a police report, contact:

Campus Police & Department of Public Safety

  801-585-COPS (801-585-2677)
  dps.utah.edu
  1735 E. S. Campus Dr.
  Salt Lake City, UT 84112

If you do not feel comfortable reporting to authorities, the U's Victim-Survivor Advocates provide free, confidential, and trauma-informed support services to students, faculty, and staff who have experienced interpersonal violence.

To privately explore options and resources available to you with an advocate, contact:

Center for Student Wellness

  801-581-7776
  wellness.utah.edu
  328 Student Services Building
  201 S. 1460 E.
  Salt Lake City, UT 84112

Academic Misconduct

It is expected that students comply with University of Utah policies regarding academic honesty, including but not limited to refraining from cheating, plagiarizing, misrepresenting one’s work, and/or inappropriately collaborating. This includes the use of generative artificial intelligence (AI) tools without citation, documentation, or authorization. Students are expected to adhere to the prescribed professional and ethical standards of the profession/discipline for which they are preparing. Any student who engages in academic dishonesty or who violates the professional and ethical standards for their profession/discipline may be subject to academic sanctions as per the University of Utah’s Student Code: Policy 6-410: Student Academic Performance, Academic Conduct, and Professional and Ethical Conduct.

Plagiarism and cheating are serious offenses and may be punished by failure on an individual assignment, and/or failure in the course. Academic misconduct, according to the University of Utah Student Code:

“...Includes, but is not limited to, cheating, misrepresenting one’s work, inappropriately collaborating, plagiarism, and fabrication or falsification of information…It also includes facilitating academic misconduct by intentionally helping or attempting to help another to commit an act of academic misconduct.”

For details on plagiarism and other important course conduct issues, see the U's Code of Student Rights and Responsibilities.