~/talk

Meta-programming with Kotlin compiler plugins

Talkat droidcon Berlin 2023 · 2023-07-05..07-07· [kotlin]
slides:none on file

Demo of a Kotlin compiler plugin that uses the K2 front-end and FIR extension register adapter to install a status transformer which flips private callable visibility to public; project uses Gradle KTS, compileOnly kotlin-compiler dependencies and a service file, runs with the compiler in-process so breakpoints hit (debug in-process). The example compiles and a private function is callable across files. Caveats: longer compile times, larger binaries, hard maintenance and unstable compiler APIs; prefer KSP when not modifying existing code.

AI-written summary · about

  1. 0:00Introduction to meta-programming
  2. 1:28Meta-programming in Kotlin
  3. 7:55Kotlin 2.0 compiler plugins
  4. 9:23Plugin structure overview
  5. 13:21Building a plugin step-by-step
  6. 21:45Debugging the plugin
  7. 23:10Modifying visibility with plugin
  8. 28:59Hard lessons learned
  9. 31:51Resources and tools
  10. 33:58Testing Kotlin compiler plugins
  11. 35:25KSP vs compiler plugins
  12. 36:09Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.