Writing Kotlin Compiler Plugins with Arrow Meta
summary
Arrow Meta provides a functional API that hooks into parsing (AST), analysis (type checking), and IR phases to build real compiler and IDE plugins. Examples show a Hello World plugin that injects a greeting at parse time, a debug-log annotation transformer that wraps a function to log arguments and runtime (example run shows ~36 ms), and a meta testing module used with compilerTest and assertThis to verify generated code. It also supports generating files via transform.newSources and IDE icons via line marker provider.
AI-written summary · about
chapters (10)
- 0:00Introduction to Arrow Meta
- 1:48How Kotlin Compiler Works
- 5:19Arrow Meta Plugin Hooks
- 7:27Hello World Plugin Example
- 14:31Debug Log Plugin Example
- 24:11Testing Compiler Plugins
- 28:21Combining Transformations
- 34:24Custom Type Checkers
- 35:31Writing IDE Plugins
- 38:48Q&A and Resources
related talks
25mArrow Meta - Enabling Functional Programming in the Kotlin Compiler
47mExtending kotlinx.serialization with Arrow Meta
01h 13mThe Magic of Kotlin Compiler Extensions
36mWriting a Kotlin Compiler Plugin
45mCompiler plugins: modifying and analyzing Compose
19mDemystifying the Kotlin Compiler
43mWriting Your First Kotlin Compiler Plugin
29mKeep insisting!
