4 ms·
> I don't see what's special or better about compiling everything into a single binary, apart from fetishizing the executable format. When you distribute your
by marcosdumay 4y ago
> I don't see what's special or better about compiling everything into a single binary, apart from fetishizing the executable format.
When you distribute your software to other people, it cuts the step of installing the correct interpreter... at the cost of requiring the correct computer architecture.
It is very likely a gain.
- somehnguy 4y agoExactly - I primarily write Java and fat-jars are great when developing apps for environments I control. But if I want to send an app to a friend it's a few additional steps to make sure they have the correct version of Java, paths are setup correct, etc. This isn't always trivial if they already have a different version of Java and want things to play nice side by side. Just bundle everything into a native executable, so many little annoyances just disappear. From what I understand Java does have facilities to bundle the runtime now but I haven't had the opportunity to really play with it yet.
- vips7L 4y ago> From what I understand Java does have facilities to bundle jlink, jpackage, and if you need something complex you can use conveyor: https://hydraulic.software/index.html https://hydraulic.software/index.html
- mike_hearn 4y agoOr even if you need something simple :-) Sending little apps to friends is easy now just like it once was, the difference is that the friends don't need to know what runtime you use. Also not only for Java: Electron, Flutter and anything else works too. We have an internal version of Conveyor that can be used to push servers as well. It bundles the jvm, makes debs with auto-scanned dependencies, systemd integration is automatically set up, it's easy to run the server with the DynamicUser feature for sandboxing and it uploads/installs the packages for you via ssh. We use it for our own servers. There seems to be more interest these days in running servers without big cloud overheads, so maybe we should launch it? It's hard to know how much demand there is for this sort of thing, though it gets rid of the hassle of manually configuring systemd and copying files around.
- ihateolives 4y ago> But if I want to send an app to a friend it's a few additional steps to make sure they have the correct version of Java, paths are setup correct, etc My friends would do full stop and reverse at "install Java" step. It will just not fly with 99% of people. It's not 1999 anymore.
- lenkite 4y agoYou can use Graal Native Image https://www.graalvm.org/22.0/reference-manual/native-image/ https://www.graalvm.org/22.0/reference-manual/native-image/ to produce a single native executable. Example of a Java Micro-service framework that has first class support for this is Quarkus (https://quarkus.io/ https://quarkus.io/). See https://quarkus.io/guides/building-native-image https://quarkus.io/guides/building-native-image For a plain Java app: "Use Maven to Build a Native Executable from a Java Application" https://www.graalvm.org/22.2/reference-manual/native-image/guides/use-native-image-maven-plugin/ https://www.graalvm.org/22.2/reference-manual/native-image/g...
- pjmlp 4y agoFor 20 years that AOT compilers for Java exist, even if only available in commercial JDKs at enterprise prices (PTC, Aonix, Aicas, Excelsior, J/Rockit, Websphere RT). That alternative would be jlink, and GraalVM / OpenJ9 as free beer AOT.
- duskwuff 4y agoGCJ was a thing for a while, but was never really production-ready.
- busterarm 4y agoAlso if you had some catastrophe where you're no longer able to build overnight or if you have to replace 100% of your infrastructure, you're still able to operate because you have a single compiled binary to ship. It eliminates whole classes of business risk. The more hosts in your fleet the more risk eliminated as well.
- JCWasmx86 4y agoYou could take it a step further and make the user download a small stub Actually Portable Executable (https://justine.lol/ape.html https://justine.lol/ape.html) which downloads the real binaries.
- eddsh1994 4y ago> it cuts the step of installing the correct interpreter... at the cost of requiring the correct computer architecture. Obviously this depends on the product but I'd give anything to worry about interpreters over the correct computer architecture in the M1/M2 Intel Embedded world.
- coldtea 4y ago>When you distribute your software to other people, it cuts the step of installing the correct interpreter... at the cost of requiring the correct computer architecture Not even, as it's trivial to cross compile on Golang. Then you just offer 3-4 arch binaries, and they download the one that matches their platform.
- davemp 4y ago> It is very likely a gain. Distributing python has to be some of the worst experiences I’ve had in the field.
- lmm 4y agoNot convinced, not if you built for e.g. Java 8. I think there's a decent chance there are more people running something other than x86_64 nowadays (and that number's only going up) than people who don't have a JVM installed.