Kotlin: Dissecting the stdlib
summary
Walks the stdlib source and shows Java bytecode and decompiled Java to prove how lambdas become a singleton lambda instance when they capture nothing and how capturing outer variables forces capture=>per-call allocation, which can hurt hot paths. Demonstrates inline, noinline and crossinline behavior — inline copies body so non‑local returns work, crossinline forbids them in callbacks — and shows reified generics enabling reified type checks and how contracts (Kotlin 1.3) let the compiler trust a lambda runs once for safe val initialization.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:53Collections API
- 6:34Function literals
- 13:15Kotlin bytecode
- 15:15Kotlin vs Java
- 19:33Higherorder functions
- 24:10Kotlin extensions
- 28:20lambdas with receivers
- 36:11closures and captures
- 40:30inlining
- 43:19return
- 49:23conventions








