Build your own compiler with KSP
summary
Shows how to build a Kotlin compiler extension using KSP plugin to scan custom annotations, implement a SymbolProcessor (meta‑services file + processor), and call the KSP CodeGenerator/visitor to emit Kotlin, JSON or JS. Claims KSP is faster than KAPT and requires matching Kotlin/KSP versions. Demonstrates a real generator that converts Compose components into Native Blocks component generator output so server UIs gain editable props; demo generates files and syncs to the panel with minor hiccups.
AI-written summary · about
chapters (8)
- 0:00Introduction to KSP
- 3:20What is a compiler
- 7:02Compiler plugins overview
- 10:42Setting up KSP project
- 14:44Writing KSP processor
- 16:50Use case: Native Blocks
- 21:35Live demo of KSP
- 25:00Conclusion and resources
related talks
33mMeta-programming with KSP and Kotlin compiler plugins
25mCode Generation Using Kotlin Symbol Processing (KSP)
38mKSP and Plugins. Optimizing Kotlin Multiplatform common code
37mWhy you should positively consider introducing and migrating to KSP
44mMeta-programming with KSP and Kotlin compiler plugins
36mFact or kapt? Build your next annotation processor with KSP
28mMetaprogramming with Kotlin Symbol Processing
15mOn the Applicability of Annotation-Based Source Code Modification in Kotlin (Work...
