One frequent annoyance as a rust programmer is slow compilation time.
Instead of solving this by waiting for faster compilers to be implemented or avoiding coding patterns which are slower to compile, could we just compile less code on our machines? How?
By creating a binary (libraries .rlib, etc) crate repository. Maybe there are so many caveats that this wouldn't be feasible in practice:
no stable abi
many platforms to support
many rust compiler versions
... and nightly
and feature flags
and compilation flags
... Panic vs about
... Integer overflow behavior
... Probably many more that I'm not thinking
users trusting the compiled assets
licence issues distributing binaries
this really only helps with public crates, not private, proprietary code compilation time.
maybe download time would be more then compilation time in some cases
As I user, I think I'd only use this if the builds were reproducible from crates.io and signed by a trusted party. (No uploading of binaries by users).
Could this work? I don't know enough about the binary format rust uses for compiled crates.
I believe serde temporarily moved to shipping with precompiled binaries in 2023, but reverted due to concerns around some of the issues you mentioned above: YC Hacker News link.
Julia has a much worse problem because they compile at runtime. So they have put a ton of effort into module precompilation, including shipping of precompiled libraries.