3 ms·
-sys are raw wrappers around C code so wouldn't provide much benefit for them to be exposed as dynlibs. And crates are the equivelant of python, node, go, etc
by epage 7y ago
-sys are raw wrappers around C code so wouldn't provide much benefit for them to be exposed as dynlibs.
And crates are the equivelant of python, node, go, etc packages. That they are also a compilation unit is, I believe, an implementation detail. I think they also made it configurable.
- gpm 7y agoWe can split one crate into multiple units for better paralleization, but I don't think there is a way to put multiple into a single compilation unit.
- steveklabnik 7y agoA crate is a compilation unit. A package is defined by a Cargo.toml, and can have one or more crates. Most folks use “package” and “crate” interchangeably, even if they’re technically different. See the bottom of https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html https://doc.rust-lang.org/book/ch07-00-managing-growing-proj... (Additionally, “compilation unit” is a bit weird, given incremental compilation, etc. “the file containing the root module tree that gets passed to rustc” is not as succinct though.)
- sanxiyn 7y agoA crate is a compilation unit. It's not configurable.