I have released the first alpha version of a Kotli...
# feed
r
I have released the first alpha version of a Kotlin multiplatform reflection library: Inspekt. It enables 100% compile time, 100% multiplatform reflection over any Kotlin or Java declaration. Features include: • Inspecting classes, functions, and properties • Top-level declaration support • Annotation instances • Function invocation, including
suspend
functions •
is
checking and casting • JVM-like proxies • Reflecting over dependencies (whether they use Inspekt or not) • Seamless reflection over Java classes • GraalVM compatible out of the box (I think, it's not tested yet, but it should be) It's feature complete and I do not plan any breaking API changes. I'm releasing as alpha only because it uses some Kotlin compiler internals and there may be edge cases my testing hasn't uncovered yet.
kodee loving 3
K 18
u
Awesome ! If I understand correctly, this would allow Compose Desktop to work with GraalVM ?
a
Smol typo to Composable Else very great product!
r
I don't think it would affect Compose/Graal either way. Reflection over composables isn't really possible due to Compose's compiler transforms. Unless there's something reflection related I'm not aware of that's blocking it?
u
It's mainly the reflectionwith AWT that poses a problem.
but I managed to do it manually
But running the agent and everything else is complicated; it would be great if we had a module that could do all that automatically.
r
If you have some details on what the reflection with awt is I can take a look
u
I'm finalizing this, and I'll publish the repo publicly.
👍 2
You can check my work; I compiled a Sample Compose app with GraalVM from the CI.
r
Ah ok, so it's a bunch of reflection that Compose is doing itself. In theory, if the Compose library converted to using something like Inspekt, then you could get rid of it. But it's something that needs to be used by the library