I was just thinking: Since Skia is a C/C++ library...
# compose-desktop
g
I was just thinking: Since Skia is a C/C++ library, is it possible to use Kotlin/Native to create Kotlin bindings for it and use it as a multiplatform library for iOS?
f
I guess that should be possible. But you can't use Compose with Kotlin Native (for now)
g
Yeah...
t
Skia does have an experimental C api, but I’m not sure how feature complete it is. AFAIK JVM based binding that use JNI (Skija/Skiko) bind the C++ API.
g
I see...
t
since you ask this in the compose channel, I assume the goal would be to get it in Skiko to run Compose. Since Skija (afaik the Skiko API is imported from there) does a (their words) hand-crafted binding, if you’d craft the same binding for the C API, it’s not an impossible goal.
l
That's what Flutter has been doing for a while actually: using skia on iOS and Android.
t
both Android and iOS support C++ (edit to clarify: in their native toolchains)
cinterop does not. of course you can link a C++ generated binary, but you need C style headers for it to do cinterop
java <-> C++ interop through JNI is very clumsy, but it does work
g
Yeah, cinterop does not play well with C++ for the moment. I hope it will come one day 🙂
Yeah, @louiscad. If That is what is making me hope that Kotlin might do the same. And Flutter uses the Dart engine/runtime...