DEV Community

Discussion on: Starting with Rust - Cargo

Collapse
 
deciduously profile image
Ben Lovy

Great write-up! Honestly, cargo is one of the biggest selling points of Rust from a usability standpoint.

Dependencies are one of the things I think Rust does right in a way I've never seen before. Cargo takes care of conflicting library dependencies automatically for you and you never need to think about what your direct deps depend on themselves. This is possible because of Rust's compiler name mangling scheme - each compiled function's mangled name ends up with information about the specific build and crate version it was from, so it's possible to have multiple conflicting versions of a function compiled in to your binary without any issues! The correct version will always be referred to by the caller. When you compile a new crate, you might see the same crate name with multiple versions come up in the list - it's incredibly cool that Rust is able to manage this in stride.

Collapse
 
vijesh_salian profile image
Vijesh Salian

Thank you for the informative comment.