Writing Kotlin Compiler Plugins with Arrow Meta
summary
Arrow Meta provides a functional API to hook into Kotlin’s parsing, analysis, resolution and IR phases and actually build plugins that run: examples include a hello world plugin that injects a println, a debugLog annotation plugin that wraps functions with timing/logging code and a generator that writes a separate adapter file. Tests use Arrow Meta’s meta-testing module with compilerTest.assertThis. Also demonstrated are composing transforms, implementing a custom type checker (overriding isSubtypeOf/equals) and an IDE line‑marker plugin; each example compiles and produces the described output.
AI-written summary · about
chapters (10)
- 0:00Introduction to Arrow Meta
- 3:24Compiler plugin basics
- 5:34Hello world plugin example
- 13:26Logging plugin with annotations
- 20:51Testing compiler plugins
- 24:04Combining transformations
- 27:55Removing and generating sources
- 31:51Custom type checking
- 35:03IDE plugins for developer experience
- 38:56Resources and Q&A
related talks
25mArrow Meta - Enabling Functional Programming in the Kotlin Compiler
47mExtending kotlinx.serialization with Arrow Meta
01h 13mThe Magic of Kotlin Compiler Extensions
19mDemystifying the Kotlin Compiler
36mWriting a Kotlin Compiler Plugin
45mCompiler plugins: modifying and analyzing Compose
43mWriting Your First Kotlin Compiler Plugin
36mMeta-programming with Kotlin compiler plugins
