3 ms·
> so most libraries split themselves up into a ton of small crates because otherwise they just take too long to compile. In practice, does this make it feasibl
by zahlman 2y ago
> so most libraries split themselves up into a ton of small crates because otherwise they just take too long to compile.
In practice, does this make it feasible to pick and choose the pieces you actually need?
- simonask 2y agoYes, when done properly. Rust has "feature flags" that can selectively enable dependencies, and effectively act as `#ifdef` guards in the code.
- Measter 2y agoIt can do. Additionally, because each part is now smaller it's now easier to ensure that each part, in isolation, does what it says on the tin. It also means that other projects can reuse the parts. An example of the last point would be the Regex crate. Regex is split into subcrates, one of which is regex-syntax: the parser. But that crate is also a dependency of over 150 other crates, including lalrpop, proptest, treesitter, and polars. So other projects have benefited from Regex being split up.