Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Cargo is not de facto better than vcpkg. That Rust has a blessed package manager instead of community of competing package managers is a lateral, neither better nor worse.


sort by: page size:

Cargo isn't competing against nor replacing distribution package managers. Cargo is a build tool, not a package manager. You're free to package Rust software the same way you do non-Rust software for specific distributions. They are entirely different unrelated things with no overlap. Cargo solves a lot of problems that we've been facing for a long time. We have the Internet now, so let's use it to speed up development.

As a name for a package manager, "cargo" certainly appears more suitable for "go" than for "rust".

There's a lot of hype around rust which may or may not pan out, but cargo should really be the gold standard for package management/build systems going forward, it's incredibly well designed. Everything is painless and integrated: builds, tests, benchmarks, publishing, installing dependencies, downloading cli binaries.

When you eventually have to go back to all the other hacked together Frankenstein alternatives out there it's a painful, frustrating experience.


> rust+cargo ... seem to think it's "sexy" to declare war on the traditional

That's not true. They do solve different problems, both are related to packaging, but still tangential to each other. You can use npm, cargo, bundler to build software which you then wrap to RPM/DEB ... system packages. I can recommend the talk that Yehuda Katz held on packaging/package managers at the Rubyconf Portugal '16 https://www.youtube.com/watch?v=Bwk8mdU6-ZY It's mostly about bundler and cargo and the design decisions behind them.


> In the Rust world there's just Cargo.

While not nearly as popular as Cargo (due to being blessed by the core team), Rust still has multiple build tools and package managers.


You really need to look at Cargo in rustlang to see what good package manager can do and how it improves development.

I've only started scratching the surface, but that rust really wants you to use Cargo, while we have our own homegrown package manager, and cmake creates a lot of friction.

I can tell you that bad programmers can write bad code in Rust.


Cargo is the one thing keeping me off the rust ecosystem. The fundamentals of the language are great, but the tight coupling of the rust language with cargo's package management really irks me - it introduces as many correctness and security problems as the memory model solves.

You assumed right, Cargo is the Rust package manager

I like rust, but I detest cargo. I don’t like that it forces a particular structure that makes every project feel like a visual studio template. I also don’t like that it has an single authoritative registry that it pulls packages from on build. This means that someone somewhere has too much control over the build process, and that I can’t work where there’s no internet access.

Is the OP aware that cargo is also the name for quite a few other things? For one the Rust package manager is named cargo.

I think it's easier for Rust (and other languages such as D, Crystal), because they started from scratch. Cargo is accepted as the way to build and distribute stuff on Rust, full stop. There are no endless debates whether Cargo should be used, or something else.

Meanwhile, in C/C++ world, build systems are a mess. You have so many tools. Some folks just use what IDE provides, e.g. MSVC solutions. Some people use CMake. Some people have their handcrafted Makefile solutions. Sure, it works on their platforms, but it's very hard to make it portable. With Cargo and similar, you just go "cargo get" (don't know the exact command, don't use Rust) and you can expect the packages to download and build as needed.


I upvoted you for the first six lines, while feeling compelled to chime in that cargo is great, an example of Rust doing things right imho.

I'd rather have a thriving and single (looking at you Python) ecosystem of third-party packages, than a standards-driven pile-on of standard libraries, with all the footguns and deprecation that tends to come with it.


Cargo (Rust) is pretty solid. Most of my minor complaints (like being unable to add packages from the CLI) have been resolved with time, as well.

I disagree. Cargo is a great distribution tool, for Rust projects. I just tell people, first install rust, then just `cargo install`

Second, this was in response to an npm is simpler comment; npm and cargo are absolutely the same category of tool.


I think it is backwards logic to cite the popularity of Cargo as validation of language-specific package management, when Cargo was officially blessed by the Rust devs:

http://blog.rust-lang.org/2014/11/20/Cargo.html

Standardizing on Cargo as a build system and package manager was a massively important technical decision that was made by the Rust devs. It will have positive and negative consequences for the language, probably for as long as it is relevant.

Rust will work really well with other rust code thanks to Cargo, but what if you want to make a complex project that mixes Rust with other languages at the package level? How about inside of one library? Rust isn't any worse than other languages on this front, but it could have been way better.


As someone who hasn't used Rust seriously since 2018, I'm tangentially curious what are the improvements (real or perceived) that buck and bazel offer over cargo? I didn't know there were alternative package managers, and cargo always seemed pretty nice to me.

I would be curious to hear what are your criticisms of cargo, too. Recently I am trying to study about dependency management in different languages, and cargo, along with bundler seems to be praised quite a bit. I can't correlate it with quality because both rust and ruby camps are quite vocal.

Seems a little unfair to cargo to give it a scathing review when your alternative ecosystem is C++ or Haskell.

The basic complaint boils down to "packages aren't namespaced" and "someone already took the 'fuse' package", which has been a long running controversy for exactly that name-squatting reason.

However, Cargo is great.

> Rust's default build system (Cargo) and package repository (crates.io) are the opposite. They combine the worst parts of Cabal/Hackage and NPM, resulting in a user experience that is somehow inferior to both.

No. They don't. That's your opinion, not a fact, and I completely disagree. Lots of people disagree. Your arbitrary assertion is unsubstantiated and I reject it. :) Perhaps you meant "resulting in a user experience that I found somehow inferior to both".

If you don't like it, and you prefer to use bazel, then by all means be welcome to do so... but I think a little bit of acknowledgement is in order that ... frankly, that behavior should be discouraged.

We want a unified good build system for rust, not a ridiculous mess of difference package managers and build systems like in some other language ecosystems. Sometimes, conformity is a better approach, and I would be deeply saddened to see rust go that way.

I'm very impressed with the efforts to bring wasm support to cargo, and the other initiatives.

Be nice. Lots of people work really hard on cargo. They're doing a great job.

next

Legal | privacy