Programming Languages and Compilers

CS 164 @ UC Berkeley, Fall 2021

This is the Fall 2021 website. If you are currently taking CS 164, please go to https://inst.eecs.berkeley.edu/~cs164/fa22/.

Schedule

Important Dates

Date # Topic Homework Due(Due @ 9 PM PT) Drill Due(Due @ Noon PT)
Wed Aug 25 1 What is a compiler?
Fri Aug 27 2 FP in OCaml: §1.1–1.5 & §2.1–2.21.
OCaml Activity 1
Mon Aug 30 3 OCaml Activity 2
Wed Sep 1 4 Homework 0
Fri Sep 3 5 S-Expressions Drill 1
Mon Sep 6 Labor Day
Wed Sep 8 7 Unary Operations
Fri Sep 10 8 Correctness and Testing
Booleans: Interpreter Edition
Drill 2
Mon Sep 13 9
Wed Sep 15 10 Booleans: Compiler Edition Homework 1
Fri Sep 17 11 Conditionals Drill 3
Mon Sep 20 12 Binary Operations
Wed Sep 22 13 Reflections on Binary Operations Naming Expressions (Let): Interpreter Edition Homework 2
Fri Sep 24 14 Naming Expressions (Let): Compiler Edition Drill 4
Mon Sep 27 15
Wed Sep 29 16 Pairs
Fri Oct 1 17 Handling Errors Drill 5
Mon Oct 4 18 Interacting with the Environment (Input)
Wed Oct 6 19 Memory Understanding Activities Homework 3
Fri Oct 8 20 Interacting with the Environment (Output) Drill 6
Mon Oct 11 21
Wed Oct 13 22 Functions Homework 4
Fri Oct 15 23 Drill 7
Mon Oct 18 24 Tail Call Optimization
Wed Oct 20 25 Parsing Homework 5
Fri Oct 22 26 Regular Expressions Activity Drill 8
Mon Oct 25 27
Wed Oct 27 28 Midterm
Fri Oct 29 29
Mon Nov 1 30 First-Class Functions (Function Pointers)
Wed Nov 3 31 Guest lecture on languages & compilers in industry
Jared Roesch, Co-founder of OctoML
Fri Nov 5 32 Drill 9
Mon Nov 8 33 First-Class Functions (Lambdas)
Kevin's Monday slides
Wed Nov 10 34 Optimization (Constant Folding) Homework 6
Fri Nov 12 35 Optimization Drill 10
Mon Nov 15 36
Wed Nov 17 37 Intermediate Representations Homework 7
Fri Nov 19 38 Register Allocation
Register Allocation Activity
Drill 11
Mon Nov 22 39 Garbage Collection
Garbage Collection Activity
Wed Nov 24 Thanksgiving break
Fri Nov 26 Thanksgiving break No Drill (Break)
Mon Nov 29 42 Type Checking
Type Checking Activity
Also please read this 3-pager before Friday's session! We've canceled the final drill to give you time for this! Reflections on Trusting Trust
Task 1 of HW 8
Wed Dec 1 43
Fri Dec 3 44 Homework 8 No Drill (Read Reflections on Trusting Trust)

Sections

  1. Introduction to OCaml
  2. Testing
  3. Compiler Infrastructure and Testing
  4. Detective Work (Debugging Assembly)
  5. How do you refer to the heap?
  6. Stack vs. Heap
  7. Fun with Drawing
  8. Midterm Review #1
  9. Midterm Review #2 (“All about the stack”)
  10. Parser Generators
  11. First-Class Functions
  12. Peephole Optimization
  13. Garbage Collection
  14. Final Review

Synchronous Events