Hacker News new | ask | show | jobs
by georgemcbay 3548 days ago
1.7 megabytes is essential nothing in both modern disk/flash space and network costs. This isn't to say that efficient, small code isn't important, but it seems really common for a lot of programmers to freak out when there's some minimum executable size required for general "runtime" stuff, even when practically speaking it doesn't really matter in the real world outside of niche embedded system applications.

If each 43 bytes you compiled expanded to ANOTHER 1.7mb, then, yeah, that's not good, but that isn't the case here.

2 comments

It might not matter to an individual user or developer, but if Rust is to be successful in the long run I think it's important for Rust-based desktop applications to be adopted.

If an application wants to be included in the standard install of, say, Ubuntu, one of the biggest costs from the Ubuntu maintainer's point of view is going to be "how much space will this take up on the iso, and what are we going to have to remove if we include this?" If the binaries are very small, it's a lot easier to make the case that they should be included.

It's easier for a distro to do dynamic linking for Rust binaries, since they can mandate a single compiler version across the ecosystem.
True. If dynamic linking is all that's needed to get tiny binaries, then that's probably sufficient from the distro's point of view.
I come from an assembly background (but spent the last 20 years doing scripting languages), so this came as a shock to me.
Now add up all the runtime stuff added by whatever scripting language you use and compare. Not many would come out ahead, Lua comes to mind.

The rust generated binary is statically linked and self-contained. It is pretty neat that it takes less than 2MB. In debug mode even, by the looks of it.