Hacker News new | ask | show | jobs
by vips7L 163 days ago
Using modules and jlink your Java image would be much smaller than 200mb. Full desktop apps with ui’s can get down to 30mb.

I’m confused by your disregard of C# AOT. It produces binaries as small as go or rust. 1.1 MB for hello world on linux.

2 comments

The problem is that packaged Java CLI utilities will also take 20MB+. The minimum size is still much too big for that class of programs. Also, AoT compilation was an absolute pain last I tried it, it's a big change for an ecosystem that was always designed as modular and dynamic. I love Java, but for CLI apps I'll take Rust whenever possible.
But it takes ages to compile. Or at least that was my experience with .NET9 a few years back.
On WSL/Fedora 43, building hello world:

    > time dotnet publish
    Restore complete (0.4s)
      dn-hw net10.0 linux-x64 succeeded (2.4s) → bin/Release/net10.0/linux-x64/publish/

    Build succeeded in 3.1s

    real    0m3.571s
    user    0m2.784s
    sys     0m0.673s

    > time go build main.go

    real    0m3.309s
    user    0m8.864s
    sys     0m1.741s

Obviously I don't know how that translates to a non-trivial application.
Are you really a developer, because it sounds like you're conflating or confusing language technologies?