Hacker News new | ask | show | jobs
by dikaiosune 3696 days ago
I like many things about Rust, but Cargo alone is what initially got me started with it. I was in the process of setting up a fresh C++ project with vendored dependencies, and it was just an absolute nightmare. In contrast, it took me about 5 minutes to get a Rust project set up with comparable dependency complexity.
2 comments

Speaking of which, is there any good package management system for modern C/C++?
Conan is the most promising one, they just released a new version:

http://blog.conan.io/2016/05/03/New-conan-release-0-9.html

Arne Mertz has a Vagrant box for people who want to experiment with a "4C" development environment (Clang, Cmake, Conan, Clion).

https://github.com/arnemertz/Xubuntu1604_DevBox

I've had biicode recommended to me (https://github.com/biicode/biicode), but I haven't tried it yet.

EDIT: Also worth noting that a common response I've heard to "I need a better manager for my dependencies" is "you have a system package manager for a reason."

What do they say when you reply "Windows"?
I think it goes without saying that those with that sort of response tend not to use Windows, and also often seem to assume that a perfectly in-order Linux/Unix install is the only way to build software.
And also that you're fine with creating a package for any dependency that doesn't have one.
Creating, maintaining, shepherding through distro processes, etc. All so you can then eventually build your own code.
Conan seems to have appeared recently but I haven't yet tried it myself. https://www.conan.io/
Even if it doesn't has too much support, I highly recommend fips: https://github.com/floooh/fips

I have been using it, adding some libs and even contributing some changes. You should really give it a try!

The Meson build system http://mesonbuild.com/ seems to have a package manager like dependency management system.
It's also very quick and easy to get projects up and running.

For *nix based platforms Meson is now my go to build manager for c++ projects.

I understand that old languages like C++ or Java have problems providing a single package manager. It seems that newer languages have roughly equivalent services.

Are there any big differences between Cargo and Python/Go/D/Ruby/Javascript/etc?

I wouldn't say Java has this problem. Look at Maven for instance. Then look back at Crates, you will notice how many common solutions they share.

On the other hand I see that Crates solves the problem of dependency when 2 different version of the same library are used across the project. Maven doesn't solve that and it's painful. However this seems a bigger problem that just a package manager I suppose.

Java has Maven Repository. This can be use from within Ant (Ivy), Maven, Gradle, sbt etc.

Both Ruby and Python are almost as old, if not older than Java. JavaScript is only slightly younger.

I find cargo easier to use than bundler or npm. Specifically I never deal with "environment hell" where some config hasn't been picked up and I'm pulling in the wrong version of a dependency or the language or whatever. This is partly because of the way cargo is designed, but its also helped a lot by the fact that Rust generates statically linked binaries in one build instead of being a continuous interpreter process.
It depends on how you define "big". Cargo is closest to Bundler + rubygems, but with some aspects of npm.
notice that some of the really old ones (perl, tex) have had package managers for a really, really long time.

I think linux (*nix?) vs non-linux heritage might have something to do with it.