https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
p

Pablo

09/29/2022, 11:48 AM
Hi, which is the best and recommended way to program user interfaces for kotlin native for windows/linux? I recently disscovered compose multiplatform, but it seems to require a JVM installed, so it's not what I'm searching for. I'm interested in learning how to develop native applications for windows/linux not dependant of a JVM.
👍🏼 1
t

thiago

09/29/2022, 12:05 PM
I have attempted to learn QT with C++ but it was a bit too steep of a learning curve to me. I am still using Kotlin+TornadoFX+JVM, but would love a native UI solution, even if it is Linux ONLY.
p

Pablo

09/29/2022, 12:58 PM
so.. there is nothing for now? I suposse compose jvm dependant whould be the best option for now... but I'm waiting to see if more people give more ideas
l

Landry Norris

09/29/2022, 1:19 PM
I liked working with GTK when I tried that.
Compose currently has experimental support for native macOS. I would imagine Linux/Windows will come at a later time, once they have Compose for UIKit working.
t

thiago

09/29/2022, 1:20 PM
well, found this (mostly) recent project with gtk bindings, might give it a shot... https://gitlab.com/gtk-kt/gtk-kt
l

Landry Norris

09/29/2022, 1:48 PM
I remember there being a project that used gtk bindings with Compose.
j

Jeff Lockhart

09/29/2022, 3:32 PM
I haven't used it, but there's https://github.com/msink/kotlin-libui from @msink.
m

msink

09/29/2022, 3:38 PM
It depends on what you want - with libui you can easily create simple interfaces, for something more complex - better use GTK or Compose.
c

corneil

09/29/2022, 4:45 PM
You can package a JVM application for the desktop as a single executable using jpackage. I would also venture that it won't be long until GraalVM native support extends to UI applications.
p

Pablo

09/29/2022, 5:52 PM
@corneil interesting point that GraalVM system, but it is GPL 2, that means is not possible use it if someone is going to sell a product?
c

corneil

09/29/2022, 6:25 PM
There is a GraalVM enterprise edition.
p

Pablo

09/29/2022, 6:29 PM
thank you, but I don't like these kind of pay per use editions, I prefeer to discard this and try with another options
maybe packaging a JVM as a single executable whould work, will that allow commercial use? maybe if i use adoptopenjdk (I don't know if it's the best and smaller option) instead of oracle jvm?
c

corneil

09/29/2022, 9:35 PM
There are multiple openjdk distributions to choose from some provide optional commercial support which may useful if you want to give your customers the option. foojay.io is one place to discover all the distributions.
2 Views