KSP vs Static Reflection

Hi guys.
This might be a dumb question but I’ve been learning KSP and I am just wondering why isn’t KSP part of the Kotlin language as static reflection and instead is provided as a library?
I think it makes more sense to have such a powerful feature as an integral part of Kotlin?

1 Like

First of all, KSP was not developed by Kotlin Team, but by Google. It is a 3rd party tool. Maybe with time it will become integrated tighter with Kotlin compiler and gradle plugin, but I have no idea if there are any plans for this.


I don’t see now how KSP can be a part of language in the current implementation, even close, not ready to be a part of the language. We may see some meta programming initiatives for Kotlin in future, but I wouldn’t expect it soon, too many big changes on the compiler in progress: k2 compiler, finalization of compiler plugins API.

There were some ideas about static reflections for Kotlin (it’s important for multiplatform), but I believe it would be much more limited than KSP and will have completely different API