GraalVM native-images apparently supports Swing ap...
# compose-desktop
s
GraalVM native-images apparently supports Swing applications with the java 16 variant in dev builds. I’m curious, has anyone tried it yet for compose-desktop?
j
I haven't heard of anyone trying it yet. I'd be super curious to hear how it goes. Since untested code never works, my assumption is you will run into some bugs, but please file issues. Just testing and filing bugs will help us to know that (1) there is interest (2) what the problems are so hopefully we can fix them.
👀 2
a
Personal opinion: it’s probably won’t be good for many real world applications, because their community edition supports only the Serial GC. Paid enterprise license supports the G1 as well, but under Java SE per-user subscription. I doubt, that the serial gc (non-parallel, non-generational, stop&copy GC) is good enough for most interactive GUI apps.
But it will be interesting to see, how it would work anyway 🙂
s
@alexey.tsvetkov Is that how graal native-image would do garbage collection as well?
a
I’m not sure I understood the question correctly, but a native image for a JVM app does need GC, there is no way around it
s
of course it needs garbage collection 🙂 I’m just wondering if it uses the same GC Algorithm. I also wonder what kind of thread locking performance we’d see on desktop/laptop processors.
m
If you want to see GUI apps as native-images in action then you just have to look at the Gluon/GraalVM native-image toolchain for JavaFX. It is available for Windows/macOS/Linux/Android/iOS and the performance is quite good. I’d say for most apps it is absolutely usable. Going this way with Compose would offer the possibility to go cross-platform (especially iOS) and be able to reuse all the Java libraries out there which are not available in Kotlin. No need to replace them with something else as you have to do in KMM.
s
I’ve seen gluon, but have avoided using it.
s
I have tried but it fails, looks like graalvm can't solve some bytecode that related to coroutines, I already have submitted issue on their github issue tracker. https://github.com/oracle/graal/issues/3342
s
@smallshen I think you’ll need to provide a reproducer / more information for your bug to get attention.
s
I'll do that rn since I got time
s
I’m watching your bug as I too am interested in using graalvm for compose desktop