Subtyping is Overrated
summary
Claim is that subtyping is overrated: implicit runtime subtyping (JavaScript, Java, C#) forces dynamic dispatch and small but real overheads, while ML/Haskell/Rust style approaches avoid them. Demonstrations compare prototype lookup cost versus a compiler match on algebraic data types, show Flow/TypeScript examples of subtype relations, and describe alternatives: Haskell type classes and Rust box traits (explicit vtable boxing) to regain dynamism. Result: same abstractions with less default runtime cost.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:00Caleb Meredith
- 2:40Plants vs Animals
- 3:55Dynamic vs Static
- 8:34What is Subtyping
- 11:49Why is Subtyping Popular
- 13:07Subtyping Adds Overhead
- 13:47How Subtyping Works
- 14:45JavaScript
- 15:17Overhead
- 16:51Supertype
- 18:08Type classes
- 20:55Outro
related talks
45mLeaky sieve of types: understanding subtype relationships in TypeScript
49mThe Trouble With Types
43mType Clash: When Structural and Nominal Systems Collide
52mWhy Static Typing Came Back
38mType Systems - The Good, Bad and Ugly
37mTyping the Untyped: Soundness in Gradual Type Systems
22mIs Space-Efficient Polymorphic Gradual Typing Possible?
45mDepending on Types
