Idea · Sep 2, 2026

Build Your Own Type Inferencer

Students implement a Hindley-Milner type inference engine for a small functional language, guided by a step-through visual debugger that animates constraint generation, unification, and the final type environment in real time.

What it would do

Type inference is one of the most elegant algorithms in programming languages, yet it is rarely taught hands-on because the implementation is intricate. This multi-week project gives students a scaffolded starter language (a subset of ML with let, lambda, and if/then/else), a specification of the HM constraint-generation rules, and a React-based visual debugger that animates each step: which constraints were generated for each AST node, which pairs the unifier is resolving, and what the substitution set looks like after each step. Students fill in the key functions (generate_constraints, unify, apply_substitution) in Python or JavaScript, run their implementation against a test suite of 30+ typed and ill-typed programs, and compare their output against a reference implementation. A stretch goal adds let-polymorphism. Appropriate for upper-division PL courses or graduate PL seminars.

Key features

  • Scaffolded mini-ML starter language with AST defined and parser provided
  • Step-through visual debugger for constraint generation and unification steps
  • Test suite of 30+ typed and ill-typed programs with expected types or type errors
  • Reference implementation for self-checking and debugging
  • Stretch goals: let-polymorphism (generalization and instantiation) and algebraic data types

More in Algorithms & Data Structures

Big-O Sonifier

Converts an algorithm's live execution trace into sound, so students can hear the difference between O(n), O(n log n), and O(n^2) as the input size grows.

Algorithms & Data StructuresTeaching toolMediumSep 23, 2026

Two-Language Concept Mirror

Show the same CS concept implemented side-by-side in three languages; Claude explains conceptual equivalences and differences, not just syntax differences.

Algorithms & Data StructuresTeaching toolMediumSep 14, 2026

State Machine Story Engine

Students implement a finite state machine engine from scratch in TypeScript, then use it to build and publish an original interactive narrative game - earning deep FSM intuition through a creative deliverable peers can play.

Algorithms & Data StructuresClass assignmentLargeSep 12, 2026

Algorithm Quest Narrator

Students build an AI dungeon master that presents classic algorithm and data structure problems as narrative adventures, adapts difficulty to player performance, and engages in Socratic dialogue without giving away solutions.

Algorithms & Data StructuresClass assignmentLargeAug 28, 2026

All 27 ideas in Algorithms & Data Structures →