What does HackerNews think of substrate?

Create native Java(FX) apps for desktop, mobile and embedded

Language: Java

#10 in Java
#33 in Java
#8 in Mobile
Haha, it's amusing that the history essays are one of the things you remember :)

Yes I think you can compile Scala and ScalaFX apps down to native binaries this way. Look at Gluon Substrate:

https://github.com/gluonhq/substrate

One of our customers is experimenting with shipping such apps with Conveyor. There's a discussion ongoing here:

https://github.com/hydraulic-software/conveyor/discussions/6...

We got a console hello world working, albeit the DX is a bit rough. You need some ugly config boilerplate and some additional Native Image json files. But, it works, at least enough to create a Mac package with the regular Conveyor feature set. There are some limits though. I think the WebView doesn't work when the app is natively compiled this way. There's also someone in our Discord who has been trying it with Compose apps.

If it all starts working well it could be quite interesting for desktop app development, as suddenly you could use high level languages and portable UI toolkits but with the sort of startup time, performance and memory usage you'd expect from native apps (modulo binary size which is still quite large). If you want to use HTML as the UI then you can use the Chromium Embedding Framework, which would give you an Electron-like experience but with many more available languages:

https://hydraulic.dev/blog/13-deploying-apps-with-jcef.html

For a Slack competitor like Linen it would make more sense to use web UI because of the video calling/WebRTC stuff. OTOH if you don't care about that, it'd be (imo) easier and more direct to not use HTML. Proper GUI toolkits give you a lot of stuff out of the box like virtualized list views which HTML still doesn't; useful for scrolling over huge datasets like chat logs.

I've been using JVM GUI for years for various tasks. It was appropriate for Bitcoin tasks because it's immune to injection attacks, because you can run everything locally with P2P protocols like the original Bitcoin app did, it's portable etc. Also I learned GUI programming decades ago and find classical UI toolkit concepts like VBox, HBox, StackPane, TableView etc more intuitive than HTML.

Yes, it can be done: JavaFX developers created a library that deals with various pitfalls of compiling it to GraalVM: https://github.com/gluonhq/substrate

I think using jpackage is easier to start with since there are less cutting-edge moving parts involved, and it imposes fewer restrictions on the runtime.

I'm actually a little excited to see where JavaFX goes today. Gluon just announced substrate [0] which uses Graal to turn JavaFX apps into native binaries.

[0] https://github.com/gluonhq/substrate