Hacker News new | ask | show | jobs
by deepsun 722 days ago
Re. native part -- I recently explored JavaFX for desktop, and found it's actually very fast, both to run and to develop in. I'd say it's a joy to use, don't understand why market now prefers other heavy-weight solutions like Electron. Maybe it was released at a wrong time, when Sun Microsystems had troubles? Maybe it was too early? Or maybe a ton of software is being written in it without fanfares, I dunno.

The whole binding stuff is neat, feels like a predecessor to Reactive Streams (which is itself is already standardized in Java under java.util.concurrent).

1 comments

Wouldn’t you need to have a JVM installed to deploy a JavaFX app? Is there something for bundling self-contained Java apps easily?
The JDK now supports building standalone executables.

https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWO...

Problem is that the entire runtime is packaged. Nice for large enterprise solutions, but not for small apps. And if I remember correctly the memory footprint isn't nice either.
But most popular modern desktop apps also bring the whole runtime packaged, just not Java (Node.js / Chromium) (Slack: 120MB, 1password: 136MB, Discord: 103MB).

So I don't see much a difference actually. 30MB is not a lot anymore, not for network, not for disk.

You can trim down the runtime[1] but the tooling around doing this is non-existent / unreliable. Alternatively, you can generate native binaries with GraalVM[2] which comes with its own baggage (license, slow compile time, etc).

[1]: https://docs.oracle.com/javase/8/embedded/develop-apps-platf...

[2]: https://www.graalvm.org/

Would this generate ~150mb images like the similarly-named jpackage or is it possible to trim down the runtime?
Yes, but Electron apps are about the same size: (Slack: 120MB, 1password: 136MB, Discord: 103MB).

But it was a problem in dial-up times, so maybe JavaFX appeared too early, when 150MB was not ok.

And Python runtime is about 20MB, but it's kinda assumed it's already installed (who knows which version though, for Python it's important, not so much with Java). Maybe Sun also expected their target audience to eventually have a JRE already installed on end-user machines.