Is it possible to have a native Compose Desktop ap...
# compose-desktop
m
Is it possible to have a native Compose Desktop application using Skija and GraalVM? As far as I know, the current implementation depends on Skiko and the JVM, which prevents creating fully native builds.
j
For what OS and what UI toolkit?
Linux has a few UI toolkits, macOS is already supported just not advertised, and I don't know anything about Windows except that it has lots of UI toolkits
m
Don't know much about UI toolkit but I just don't like the JVM (heavy startup, huge memory usage) I more like Kotlin/Native than Kotlin/JVM. Looking for a way to build native compose desktop app with Kotlin/Native.
j
Well the JVM also provides a unified abstraction for integration into the native UI system, so it's also of great benefit
If you want to go properly native you have a long, uphill battle
h
Also, are you sure Kotlin Native will perform better and it’s worth? It really depends on the application logic, and the UI toolkit.
You can optimize the JVM a lot.
j
It definitely won't be better. It's more like how much worse. We've run Compose on native but not Compose UI. Obviously it runs on iOS and the like so it's probably still usable.
n
you shouldn't choose kotlin native for its "perfomance" – it never was a goal of it and JVM will outperform it most definitely you can always fine-tune jvm settings for your apps, making it less painful in terms of memory consumption. I saw compose desktop running with 128MB restriction
m
What about the startup time then?
n
i don't think for most apps jvm startup time is a big bottleneck if any at all. i am not sure about compose, but afaik you may compile app with awt & swing with graalvm to native code, but it's not available for either windows or macos (don't remember) and a lil of maintenance headache for initial setup but I'm pretty sure you might overestimate problem of jvm startup time – it's not that huge and if you see something really noticable, problem is probably not with JVM itself
for startup time I would say kotlin/native definitely wins, but yoy cover one problem with a whole bunch of others. If you really want to be as optimized as possible, go with Qt and C++ I guess
j
Plus AppCDS and the extensions they're working on in the modern versions are all about reducing startup
p