Skip to main content
CourseFlix

Building a Typechecker from scratch

2h 16m 15s
English
Paid

Static typecheckers help you catch errors early and keep your code safe. They also make debugging easier. In this course, you see how a typechecker works and how you can build one step by step.

You may ask: What is type checking? What is type inference? How do type rules work? Is my language weak or strong? And how do I build a typechecker at all? This course gives clear answers with a full hands-on build.

Many books focus on theory and treat types as abstract math. This course takes a more direct path. You build a real static typechecker for a real language in a few hours. Every idea comes with clear code and live examples.

You start coding in the first lecture. You learn how a typechecker fits into a language stack and why it helps you grow as an engineer.

What You Learn

You build a static typechecker similar to the ones used in Java, TypeScript, and other typed languages. You learn core ideas from type theory only when they help you code the next step.

Prerequisites

You do not need any formal background in type theory. But you should know how an interpreter works. The optional course Building an Interpreter from scratch helps with this.

If you understand terms like eval, closure, scope chain, and environment, you are ready to start. If not, take the interpreter course first.

Who This Course Is For

This course is for engineers who want to build complex systems and learn how static analysis works. It is also for anyone who builds a language, enjoys compilers, or wants a clear view of type systems.

Tools You Use

You do not need a special “types-first” language to build a typechecker. You use plain JavaScript to keep the ideas simple. The logic then maps cleanly to TypeScript, Rust, OCaml, Python, C++, or any other language you prefer.

How You Learn

You write each part of the typechecker yourself. The video lessons show the full source code, but the repo includes tasks marked with /* Implement here */. You fill these in during the course so you understand every detail.

About the Author: Dmitry Soshnikov

Dmitry Soshnikov thumbnail

Dmitry Soshnikov is a Russian software engineer and educator focused on programming-language internals, compiler construction, JavaScript engine architecture, and the theoretical computer-science foundations underneath modern software development. His independent course catalog is one of the deepest sources of long-form material on language implementation available outside university CS programs.

His CourseFlix listing carries nine courses spanning parser combinators, interpreter construction, garbage-collection algorithm internals, the design of pattern-matching engines, and JavaScript object-model deep dives. Material is paid and aimed at engineers who want to understand how the languages they use every day actually work under the hood.

Watch Online 20 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 20 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introduction to Type theory and checking
All Course Lessons (20)
#Lesson TitleDurationAccess
1
Introduction to Type theory and checking Demo
19:39
2
Typing Numbers and Strings | Testing
04:18
3
Math binary operations | String concat
06:46
4
Variables and Typing Environment, Р“
08:17
5
Blocks and Local scope
06:55
6
Parsing: S-expression to AST
07:31
7
Control flow: If and While expressions
07:25
8
User-defined functions | Local environments
09:16
9
Function calls | Built-in functions
04:42
10
Closures | Recursive calls
05:12
11
Lambda functions and IILE | Syntactic sugar
04:30
12
Declaring new types | Type aliases
03:54
13
OOP | Classes
06:40
14
OOP | Instances
03:51
15
Super calls | Inheritance
02:49
16
Union type
06:02
17
Union | Type narrowing
07:24
18
Generics | Function declarations
06:51
19
Generics | Function calls
07:09
20
Final executable
07:04
Unlock unlimited learning

Get instant access to all 19 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

  • JavaScript Error Handling thumbnail

    JavaScript Error Handling

    Sources: Vue School
    Master the art of creating reliable and maintainable JavaScript applications with our comprehensive course on error handling. You will learn professional...
    54 minutes 59 seconds
  • Build Telegram Bots with JavaScript: The Complete Guide thumbnail

    Build Telegram Bots with JavaScript: The Complete Guide

    Sources: Udemy
    Telegram is a cloud-based instant messaging app that provides API to developers to create bots that interact with users. This course aims to provide you with co
    5 hours 28 minutes 48 seconds
  • Mastering JavaScript Unit Testing thumbnailFree

    Mastering JavaScript Unit Testing

    Sources: Mosh Hamedani (Code with Mosh)
    A comprehensive, beginner-friendly guide covering everything from the basics to advanced techniques. Tired of piecing together disconnected tutorials or dealing with rambling…
    3 hours 51 minutes 31 seconds 5 / 5