Crash Course on the Kotlin Compiler
summary
Step‑by‑step tour of how Kotlin code becomes JVM bytecode, with concrete examples: reverse engineering compiler plugins (the Sam‑with‑receiver plugin source and Gradle/CLI registration), K1 vs fir front end data formats and resolver stages, and the Compose back‑end that injects a synthetic composer via IR transformations showing the exact IR edits, generated bitmask logic, and where tests and PSI/descriptor mappings are needed. Builds run locally (note: compiler and compose required different Java versions) and inspected code actually compiles.
AI-written summary · about
chapters (9)
- 0:00Introduction to Kotlin
- 1:42Compiler oversimplification
- 3:35K1 front end internals
- 6:57K2 front end and FIR
- 10:38Compiler back end IR
- 13:00Front end plugin example
- 19:53Jetpack Compose plugin
- 27:49Compiler resources
- 29:40Q&A and testing








