I am a bit confused: is Compose for Desktop runnin...
# compose-desktop
d
I am a bit confused: is Compose for Desktop running on JVM for all 3 OS: Windows, Linux, MacOs?
👌 6
🤔 1
j
👌
d
for some reason I was sure Desktop Compose apps were compiled using Kotlin/Native
j
Probably because it's completely transparent to the end user. Compose for Desktop produces binaries that bundle the JVM inside, so the user does not need to install a JVM nor do they even need to know that it uses a JVM internally.
👍 7
d
Maybe I got confused by this:
message has been deleted
I was looking at the PeopleInSpace gradle file, and it mentions
macosX64
as well as
jvm
so, I was assuming apps for MacOS don’t use JVM
j
PeopleInSpace is sharing kmp modules if I remember, but it uses swift UI in macos
not sure tbh, @John O'Reilly has a lot of kmp projects :P
j
The project has both a SwiftUI macOS app along with a Compose for Desktop one (which uses JVM as mentioned here)
👍 1
d
OK, I got it now! So, basically there are two MacOS apps there, one in Compose and one in SwiftUI, right?
j
well, sort of 🙂 It's a macOS Compose one only if you're running it on macOS 🙂
d
I guess you mean, if you are NOT running a macOS machine?
j
sorry, no, what I meant is that, given as it's JVM based, it will run on whichever platform you happened to be on ....it's not macOS specific (as the SwiftUI one is)
d
Ok, I see what you mean. What about for producing a MacOS binary for the Compose app. Do you need to run a MacOS machine?
j
I think so but not certain
yeah, and I guess I should have clarified above that "it will run on whichever platform you happened to be on" is based of course on running from source.....if you've produced binaries then they'll only run on whatever platforms they've been targeted for
c
@jim new to java desktop development but
Compose for Desktop produces binaries that bundle the JVM inside, so the user does not need to install a JVM nor do they even need to know that it uses a JVM internally.
This has the "tradeoff" that the JVM could potentially take up significant bundle size or is the jvm fairly small?
j
The JVM is divided up into modules, and you specify which modules you want to bundle, so in practice the JVM you bundle only supports the functionality you want to use and thus ends up being dramatically smaller than a full JVM. Also, binary size is generally less important on desktops, as compared to web where binary size impacts load time or mobile where binaries must be downloaded over cellular networks and then stored on underpowered devices.
👍 2
c
Is there an option in Compose Desktop to generate binaries/JARs without the bundled JVM as an option for users that already have a full one installed?
d
I completely agree that binary size on Desktop is not an issue. However it would be interesting to know how different in size would be a macOS app based on Compose and SwiftUI. @John O'Reilly are you able to provide a figure, through the PeopleInSpace sample app?
s
Is there an option in Compose Desktop to generate binaries/JARs without the bundled JVM
@CLOVIS yes,
./gradlew packageUberJarForCurrentOS
475 Views