Member-only story

Under-the-hood of type systems (e.g. TypeScript)

Craig Taub
12 min readMay 7, 2020

--

I struggled to find an explanation from a low-level view of exactly how a “JavaScript type system compiler” is implemented. I understood many of the jobs of a type system but was unsure of the mechanisms involved and how they worked together.

This article will aim to shine a light on some of the fundamentals at work under-the-hood. It is not possible to focus on everything in 1 article so here we will be looking at “type checks” specifically. Starting with an overview of type systems then building our own compiler which can run type checks and output sensible messages. For more help on transforms please see my article or talks on Web Bundlers or Source Maps.

This is part of my “under-the-hood of” series:

A video for this talk can be found here. Part of my “under-the-hood of” video series here.

NOTE: Apologies as there is some repetition in this article with my previous article on Source Maps. But it is important to include all of the necessary information to understand the mechanisms we will be looking at today.

This article will be broken down into (click links to navigate):

--

--

Craig Taub
Craig Taub

No responses yet

Write a response