The design of JavaScript type systems
summary
Explains why and how several type systems were added to JavaScript over the last decade, comparing their core features to traditional systems like Java’s and highlighting key differences. Describes how to implement a JavaScript type checker (using concepts from Closure Compiler) and how to apply such a checker in practice, finishing with brief commentary on future directions for type systems in dynamic languages.
AI-written summary · about
chapters (15)
- 0:00Start
- 0:13Overview
- 1:07Brief history of JS types
- 3:14Requirements for a JavaScript type system
- 5:21Familiar features in JS type systems
- 8:11Structural typing
- 8:59Unions and flow-sensitive typing
- 13:13Sources of unsoundness
- 16:40How does a JavaScript type checker work?
- 17:23Phase 1: Collect and resolve types
- 18:49Phase 2: Typecheck each function in isolation
- 21:17Evaluating the quality of a JS type checker
- 25:30How to write JavaScript that typechecks well
- 29:43So, what's next for JS types?
- 32:22Type systems for other dynamic languages The design requirements are the same in other languages.
related talks
22mType Systems Will Make You a Better JavaScript Developer
27mBeyond JavaScript
25mStatic types in JavaScript: what, how and why
27mA Story About Types and JavaScript
01h 11mTypeScript: Static types for JavaScript
22mBeyond JavaScript: The languages for the modern Web
25mWhy static types in Javascript? — Preethi Kasireddy
53m"Strict" JavaScript: Types Versus Reality
