Artificial Intelligence · 31.07.2026, 11:48 UTC
JetBrains Open-Sources KotlinLLM: Smart Macros That Generate Kotlin Source Code at Runtime and Hot-Reload It Through JDI
| Schweregrad | info |
|---|---|
| Kategorie | Artificial Intelligence |
| Quelle | MarkTechPost ↗ |
| Veröffentlicht | 31.07.2026 UTC |
Sicherheitsmeldung mit Schweregrad noch nicht bewertet. Technische Details im Tab „Originaltext“; empfohlene Schritte in der Checkliste.
JetBrains Research Open-Sources KotlinLLM. KotlinLLM is an IntelliJ IDEA plugin for Kotlin/JVM projects that adds a language feature called Smart macros. A Smart macro is a regular Kotlin function call whose body is generated Kotlin code. The public API is deliberately small. asLlm<F, T>(from, hint) converts an input of type F into a typed value T, such as a data class, enum, list, or primitive. mockLlm<T>() generates a stateful implementation of an interface T, whose behavior depends on which methods are called on it.
Copy CodeCopiedUse a different Browserval issuesApiUrl: String = asLlm(repoInput, hint = "GitHub API URL: get all issues, including closed") val issues: List<Issue> = asLlm(response, hint = "Return all beginner-friendly issues for this repository")
The runtime loop
When a project launches through the KotlinLLM run configuration, the plugin scans for asLlm and mockLlm calls, updates generated bootstrap/provider/parser/mock files, launches the run configuration under JDI, and registers breakpoints on generated regenerate hooks. If generated logic does not match a runtime scenario, execution reaches a hook. The plugin captures runtime values and type information from the suspended frame, the LLM agent submits a code update, and the plugin compiles it and redefines the loaded class before retrying the original call.
KotlinLLM targets Kotlin/JVM specifically because the runtime evolution loop depends on JVM class redefinition through JDI.
Explainer: how a Smart macro evolves
The embed below walks the macro API, animates the nine-step runtime loop, and …