News for hackers. Stuff that matters.
Re:JavaFX 19 by capableweb on Wednesday September 14, 2022 @08:04AM (#32835983)
Would be really awesome if JavaFX could work together with GraalVM and Clojure. Then I'd be in "desktop application development" nirvana, when I can ship binaries to all platforms and build the application itself with cljfx (https://github.com/cljfx/cljfx).

Once every ~6 months for the last 2 years or something I've given it a try but there is always something broken or missing. Not sure what the status is right now.

Re:JavaFX 19 by phforms on Wednesday September 14, 2022 @08:31AM (#32836210)
I tried cljfx earlier this year for a prototype and was really satisfied with the developing experience. But I was also quite disappointed when I learned about the GraalVM incompatibility; it would have been a dream to have AOT and fast startup times.
Re:JavaFX 19 by karmakaze on Wednesday September 14, 2022 @12:04PM (#32839117)
What were the startup times like without AOT and how large/complex was your prototype?
Re:JavaFX 19 by zeroth32 on Wednesday September 14, 2022 @08:33AM (#32836236)
Kotlin folks are working on something like that. There is multiplatform UI toolkit that targets native, android, java desktop, web and who knows what. I do not remember the name (Synergy, Fusion?, jetpack?)
Re:JavaFX 19 by usrusr on Wednesday September 14, 2022 @08:49AM (#32836419)
Compose. It's the "new style" UI on Android. There, its full name is "jetpack compose" and it's a much bigger break from what came before than JavaFX vs Swing/AWT. Jetbrains are doing a port to desktop under the name of "compose desktop".
Re:JavaFX 19 by rroot on Wednesday September 14, 2022 @08:47AM (#32836398)
Re:JavaFX 19 by ipsi on Wednesday September 14, 2022 @08:12AM (#32836050)
It does work with GraalVM (although the last time I did anything with that, I went through Gluon, which provides a bunch of wrappers around it). I have no idea if Clojure works with GraalVM, but if it does I guess the only missing piece is doing all the work the Graal & Gluon Maven/Gradle plugins do in cljfx? Plus the multi-minute build cycle which requires several GB of RAM, but that's a whole different kettle of fish.
Re:JavaFX 19 by sph on Wednesday September 14, 2022 @08:08AM (#32836023)
I know nothing about the Java ecosystem. Isn't Clojure supposed to be compatible with the JVM and everything that runs of top of it?
Re:JavaFX 19 by ipsi on Wednesday September 14, 2022 @08:24AM (#32836150)
GraalVM is really more like a very specialised JVM that can be used to spit out a native binary for any platform for which there exists a GraalVM version.

But in order to do that, it does some interesting things under the hood, and it doesn't play nicely with reflection by default (amongst other things). For some non-Java JVM languages that's a major problem since their compiler produces JVM byte code that relies heavily on reflection (Groovy is/was a great example of this). I'm unsure how much, if any, reflection Clojure relies on but that would be the most likely reason for it to struggle with GraalVM compatibility.

Re:JavaFX 19 by kaba0 on Wednesday September 14, 2022 @10:07AM (#32837390)
Well, the reason behind all that is that Graal has a closed-world assumption regarding classes - it has to know about every class file that will potentially get loaded at runtime.
Re:JavaFX 19 by chrisseaton on Wednesday September 14, 2022 @08:45AM (#32836367)
SubstrateVM (which is what everyone here means when they say ‘GraalVM’) is not a compliant JVM, except for a get-out that just runs a normal JVM as a launcher.
Re:JavaFX 19 by vbezhenar on Wednesday September 14, 2022 @08:16AM (#32836076)
Clojure is compatible. GraalVM is not compatible.
Re:JavaFX 19 by cmiles74 on Wednesday September 14, 2022 @08:19AM (#32836104)
You can definitely call JavaFX from Clojure. There's also the cljfx project that is "declarative and functional". :-)

https://github.com/cljfx/cljfx