4 ms·
> I like Rust as much as the next guy, but currently Rust (and Go for that matter) binaries are comparatively enormous (compared to C or C++, i.e. compared to s
by reificator 7y ago
> I like Rust as much as the next guy, but currently Rust (and Go for that matter) binaries are comparatively enormous (compared to C or C++, i.e. compared to systemd).
> I have not looked at systemd in a while, but I'd be surprised it systemd in total is not smaller than the Rust runtime, which would leave your minimal subset larger than the original.
Isn't this simply a result of the C runtime not being bundled with the executable? How does the comparison look when accounting for that difference?
- Gibbon1 7y agoC does type erasure, doesn't do runtime checking and maps most everything to assembly. I haven't checked recently but last time I did Rust's bare metal binaries were larger than C ones. Might be better now. That said you can beat C's code size with hand assembly and p-code interpreters.
- nwmcsween 7y agoDepends obviously but in general small, busybox is statically linked that uses a relatively large swath of libc and you can compare different libc versions somewhat by looking at the tags here: https://hub.docker.com/_/busybox?tab=tags https://hub.docker.com/_/busybox?tab=tags. If parent was correct you could link all of musl libc and have 1.3MB or so left over for an actual application. It also depends on the how the code is structured, musl for example is structured not to pull in unneeded objects while the size of the glibc docker container speaks for itself.