What's Behind Generics in Go
summary
Explains the design and implementation choices behind Go generics: why Go uses the [T any] syntax, how Go generics differ from other languages’ generics, and internal concepts like “gc shape” that underpin their behavior and performance.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 0:27Speaker intro
- 1:11What is polymorphism
- 3:14Polymorphic types
- 4:45Parametric polymorphism
- 6:29Ad-hoc polymorphism in Go
- 7:11Boxing in Go 1.18
- 8:16Monomorphization in Go
- 9:39GCShape concept
- 12:05Non-monomorphic functions
- 14:13Performance impact of GCShape
- 15:37Generic vs interface benchmarks
- 17:02Generics hype
- 18:04Q&A: Monomorphization
- 19:27Q&A: Pointer types
- 20:31Q&A: Comparable types
- 22:20Q&A: VS Code example
- 23:03Q&A: Go generics future
- 24:47Q&A: Why Go for theory
- 26:11Q&A: Comparable types deep dive
- 26:54Q&A: Generics development
- 27:15Closing
