Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C doesn't either, but statically linking still pulls only the object files which are actually needed into the executable.


I think that's the main reason why every stdlib function lives in its own source file in MUSL:

https://git.musl-libc.org/cgit/musl/tree/src/stdio

Not sure if this can easily be replicated in Rust though and LTO must be used instead for dead code removal.


A Rust crate is a single translation unit. It's the precise equivalent of a C source or object file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: