Re:Using Java 9 Modularization to Ship Zero-Dependency Nativ...
by unscaled on Sunday October 22, 2017 @10:12PM
(#15530198)
It's a matter of platform and the libraries that you're using.
After all, back in the days we had 360k floppy disks, and executable written in C which did much more than just printing out "Hello world" would fit comfortably into less than half of that.
Modern C and C++ runtimes are bloated, because a 2MB executable isn't considered huge anymore and dynamic linking is common.
But you can have a 5k static executable printing "hello world" on Linux if you just trade in your stdlibc to musl.
People have also managed to use musl with Rust to produce pretty small executables:
https://lifthrasiir.github.io/rustlog/why-is-a-rust-executab...
After all, back in the days we had 360k floppy disks, and executable written in C which did much more than just printing out "Hello world" would fit comfortably into less than half of that.
Modern C and C++ runtimes are bloated, because a 2MB executable isn't considered huge anymore and dynamic linking is common.
But you can have a 5k static executable printing "hello world" on Linux if you just trade in your stdlibc to musl. People have also managed to use musl with Rust to produce pretty small executables: https://lifthrasiir.github.io/rustlog/why-is-a-rust-executab...