Skip to content
JS

Write a Compiler That Understands Types

Course on Master.dev by Richard Feldman

View on Master.dev (opens in a new tab)
4 h 50 min
LengthVideo runtime
Subscription
Price modelMaster.dev plan
26
Lessons
Jun 2025
Published10 Jun 2025

About this course

Description from Master.dev

Ever wonder how TypeScript figures out types? Type inference might seem like magic, but you'll implement it step by step using the powerful Hindley-Milner system. Construct each part of a working compiler, including parsing, scope resolution, type inference, and bytecode generation. Deepen your understanding of language design and compiler internals by building a type system from scratch!

What it covers

26 lessons
  1. 01

    Introduction

    1. Introduction
    2. Terminology & Internal Architecture
  2. 02

    Traversing the AST

    1. Formatter: Lexing, Parsing & Output
    2. Formatter Exercise
  3. 03

    Bindings & Scope Resolution

    1. Name Resolution
    2. Hoisting
    3. Name Resolution Exercise
  4. 04

    Type Inference

    1. Hindley-Milner Type System
    2. Inferring Constants
    3. Path Compression
    4. Type Check Exercise
    5. Type Unification
    6. Type Unification Q&A
    7. Unify Multiplication Operator Exercise
  5. 05

    Inferring Types

    1. Inferring Conditionals
    2. Inferring Function Declarations
    3. Inferring Function Calls
    4. Inferring Functions Exercise
  6. 06

    Polymorphism & Type Signatures

    1. Polymorphism
    2. Polymorphic Functions
    3. Type Annotations
    4. Polymorphism Exercise
  7. 07

    Generating WASM

    1. Generating Web Assembly (WASM)
    2. WASM Exercise
    3. Polymorphic and Monomorphic Function Generation
  8. 08

    Wrapping Up

    1. Wrapping Up

Similar TypeScript courses

  1. Intermediate TypeScript, v2

    Master.dev · Mike North · 33 lessons · Dec 2023

    5 h 3 minSubscription
    Master.dev33Dec 2023
  2. Enterprise TypeScript

    Master.dev · Mike North · 26 lessons · Dec 2023

    5 h 10 minSubscription
    Master.dev26Dec 2023
  3. Production-Grade TypeScript

    Master.dev · Mike North · 33 lessons · Nov 2020

    5 h 10 minSubscription
    Master.dev33Nov 2020
  4. Beginner4 h
    Codecademy2Dec 2022
  5. The Definitive Guide to MongoDB

    Educative · Nikola Zivkovic · 41 lessons · Apr 2026

    Intermediate6 hSubscription
    Educative41Apr 2026
  6. Learn Intermediate TypeScript

    Codecademy · 3 lessons · Oct 2022

    Intermediate3 h
    Codecademy3Oct 2022
  7. Get Up and Running with TypeScript

    Coursera · Harrison Kong · Mar 2021

    Beginner2 h
    CourseraMar 2021
  8. Beginner2 h
    Codecademy1Dec 2022

A hyphen means the provider's catalogue does not state the value.

Same topic, nearest in length, up to three from any one provider.

Data read from the Master.dev catalogue on 28 Nov 2026. How the data is collected.

    Compare