UIUC CS 421: Programming Languages and Compilers
CS 421 covers functional programming in OCaml, lambda calculus, operational semantics, type systems and inference, parsing, and interpreter construction. It's a required core course for UIUC CS majors and most students' first serious encounter with the functional paradigm.
Fennie is independent and not affiliated with University of Illinois Urbana-Champaign. This is an unofficial study guide.
What makes it hard
The paradigm shift is the wall: recursion replacing loops, immutability replacing state, and types doing work students have never asked types to do. Exam questions on unification, evaluation order, and typing derivations demand stepwise precision that cramming can't fake.
What you'll cover
- • Functional programming in OCaml
- • Recursion and higher-order functions
- • Lambda calculus
- • Type systems and type inference
- • Operational semantics
- • Parsing and interpreters
The CS 421 study guide
How to study for UIUC CS 421, step by step.
- 1
Commit to the functional style immediately
Fighting OCaml by writing imperative code in disguise prolongs the adjustment. Practice small recursive and higher-order-function exercises daily for the first month; fluency here discounts everything after.
- 2
Work the formal systems on paper
Typing derivations, unification steps, and evaluation rules are graded as exact sequences. Write them out by hand, rule by rule, until the bookkeeping is automatic. Recognition is not production.
- 3
Trace evaluation order until it's boring
Questions about what reduces when (eager versus lazy, applicative versus normal order) are exam staples. Trace small expressions step by step rather than trusting intuition built on imperative languages.
- 4
Use the MPs to cement the lectures
The interpreter and type-checker assignments implement exactly what lecture formalizes. Connecting each MP to its theory unit while both are fresh is the course's intended learning loop.
Today
Today's CS 421 plan
What a Fennie Daily Plan looks like for CS 421. Yours is built from your own syllabus and adapts every day to your deadlines and progress.
First plan free, no card required. Fennie is independent and unaffiliated with your school.
FAQ
Is CS 421 hard at UIUC?
Its difficulty is concentrated in the paradigm shift: students who embrace functional style early find the back half smooth, while students who fight OCaml struggle all semester. The formal material rewards paper practice over rereading.
Do I need to know OCaml before CS 421?
No. The course teaches it from scratch, and prior functional experience in any language transfers well. What matters is committing to recursive, immutable style early instead of writing imperative code with OCaml syntax.
How do I study for CS 421 exams?
Produce, don't recognize: write typing derivations, unification steps, and evaluation traces by hand until the rule bookkeeping is automatic. Past exams and the MP material map closely to what's tested.
More UIUC courses
CS 124: Introduction to Computer Science I
CS 124 is UIUC's first programming course for CS majors, taught in Java or Kotlin (students choose), covering programming fundamentals through basic data structures and even Android development. It replaced the old CS 125 and is known for its polished homework infrastructure with daily small assignments.
CS 128: Introduction to Computer Science II
CS 128 is the second course in UIUC's CS sequence, moving students into C++ with memory management, object-oriented design, and an introduction to data structures and software engineering practice. It bridges CS 124 and the heavyweight CS 225.
CS 173: Discrete Structures
CS 173 is UIUC's discrete math course, covering logic, proofs, induction, sets, functions, graphs, and counting. It's the theory foundation for CS 225 and the algorithms coursework beyond. For most students it's their first proof-based mathematics.
CS 225: Data Structures
CS 225 is UIUC's famous data structures course in C++, covering lists, trees, AVL and B-trees, hashing, heaps, disjoint sets, and graph algorithms, delivered through MPs (machine problems) and weekly labs. It's the make-or-break course of the CS major and the one alumni still talk about.