upvote
> Anyway I don't understand the aversion to just using submodules.

The reason is highlighted in the article: Submodules break down catastrophically for shared transitive dependencies, which means that you can't have shared "vocabulary" types outside of the standard library.

reply
No they don't? You just add the shared transitive dependency as a submodule in the top-level project and express in the build system that it's a dependency in the library's meson.build.

As a significant bonus, this makes the transitive dependencies very visible and provides ecosystem pressure for libraries to reduce their number of dependencies. This is a good thing. Other package management schemes make it a bit too easy to ignore transitive dependencies in my book.

reply
I'm sure you can see how that doesn't scale without significant effort. Stuff like this is why dependency management in large C++ projects is extremely draining. And if you don't get it right, boom, ODR violation = UB.

The end result is that many C++ projects spend a huge amount of time whenever a dependency is added or updated, so they tend to avoid it and lag behind, leaving performance and bugfixes on the table.

Meanwhile, Cargo even supports linking multiple versions of the same dependency without issue in the same binary. It is lightyears ahead.

reply
Sure, it doesn't scale to your typical node.js project with thousands of dependencies. That's a good thing.
reply
ffmpeg has 100+ transitive dependencies. I don't see what language or language package managers have to do with the number of transitive dependencies.
reply
Classic sour grapes.
reply
I find working with node.js projects with thousands of dependencies to be very uncomfortable, when I'm doing web stuff I go out of my way to try to avoid that for the most part but it feels like I'm fighting the ecosystem the whole way.

If that's sour grapes then so be it.

reply
"it's not a bug, it's a feature"
reply
Exactly. Reading that entire exchange I just kept thinking things like "but why would you want that" and "but doesn't that lead to insecure software".

When I use languages that aren't C or C++ I actually audit my dependencies and I don't adopt libraries that would transitively add half a dozen to my project. The result is that I generally can't find acceptable candidates and I end up rolling my own. So I very strongly prefer to remain in the C++ ecosystem where I can check a header only solution into my source tree and just get on with life. (Related, eigen is a work of art.)

But if you really feel you need package management and you can't stomach cmake then consider an agnostic nix-alike or the one that your OS relies on rather than something language specific. Package management should be left to dedicated package managers. I shouldn't need half a dozen different managers pulling from their own centralized repositories.

reply
Oh yea, it's the way every other popular language does it that is unsafe. Not C++.

Custom and out of date code we manually audit is better than packages that can be automatically scanned for known issues.

reply
Well yeah. When things become easier, people do it more, whether it's good or bad. Therefore, good things should be easy and bad things should be hard.

Having thousands of transitive dependencies in a super deep dependency graph is bad.

I really like Rust, but I think there's a convincing argument to be made that if you had to manually run 'cargo add' for every dependency, not just the direct ones, its ecosystem would be in a better state. Those transitive dependencies are part of your project. You should be aware of them and have a relationship with them and vet them.

reply
There’s lots of things we “should” do but don’t. I can agree with you that having lots and lots of transitive dependencies isn’t a good thing, but the thing is, it does remove a lot of day-to-day headaches for people and allows them to work at speeds they couldn’t before. That’s a good thing for them that they value at the expense of most other things.

People want results first, optimisation later. This gives them that.

There’s also a good argument to be made that you shouldn’t always give people what they want, but it’s easy to see why Cargo is so popular.

reply
I agree with your premise and disagree with your conclusion.

There's a lot we "should" do but don't. That's exactly why I think incentives are so important. When I want to add a Cargo dependency, I should look through every dependency that was added after running 'cargo add' and vet it. But I don't, because it's so easy to not do that.

If I had to run 'cargo add' for each transitive dependency manually, there would be two positive effects:

1. I would be forced to at least be aware of which transitive dependencies I'm adding, I can't just ignore them anymore. This is at least a part of the vetting I should be doing today but don't.

2. It would incentivise libraries to use fewer dependencies, because each one would add extra work for the user. The C++ ecosystem has a ton of those "dependency-free header-only" libraries because both being header-only and being dependency-free makes adoption easier in C++. A similar (though lesser) phenomenon would affect Rust if Cargo made you manually add each transitive dependency.

reply
Pious suffering is not a virtue.

We're trying to get thing done, here.

reply
Where did I advocate for suffering and not getting things done
reply
In your entire comment?

You're taking the baffling position that managing dependencies should be hard, tiresome, high-friction.

You're free to suffer on your own, but the rest of us will absolutely move on.

reply
I disagree with your characterization. I have laid out my argument. Can you kindly either fuck off or explain which part you think is incorrect?
reply
> Microsoft Visual C++ package manager

vcpkg is certainly created and maintained by Microsoft.

But it is not for Visual C++. Visual Studio build tools is supported, and it's the default (but not only option) on Windows. But it supports other platforms and build tools too.

reply
The "vc" in "vcpkg" stands for Visual C++.
reply
Because that is where it was born, and the team that owns the project.
reply
And it means it's completely uninteresting in my eyes.
reply
Nowadays that will cut out plenty of open source projects, given Microsoft sponsorship.
reply
Which other interesting projects are called Microsoft Visual C++ anything? I'm not sure I've seen any that piqued my interest
reply
Ah so Microsoft can sponsor whatever they feel like, just not prefix the name with vc.
reply
Why do you think I would care about a project receiving money from Microsoft? I don't love Microsoft-owned projects and I especially don't like Microsoft Visual C++ but if Microsoft just wants to give a project some money, why would I care
reply
Because usually we get this attitude, "And it means it's completely uninteresting in my eyes.", while at the same time it gets invalidated by using other technology exactly from the same company.
reply
By "from the same company", do you mean "projects run by Microsoft" or "projects which Microsoft sometimes gives money to"? I avoid the former as much as is reasonably possible, while I truly couldn't give a damn about the latter as long as it doesn't result in undue control.

If I wanted a package manager, I'd have to pick between the Microsoft Visual C++ package manager, and Conan. There's no world where I pick the Microsoft Visual C++ one over Conan.

But it happens to be the case that I haven't felt the need for a C++ package manager. I'm happy using a combination of system packages, vendored dependencies, submodules, meson subprojects and meson wrap files.

I do sometimes use Typescript because there's no reasonable alternative and the advantage of having type-checked JavaScript outweighs the downside of using a Microsoft language. So there's that. Every choice has trade-offs.

reply
The Conan package manager is cross-platform and just what the doctor ordered for C/C++.

https://conan.io/

reply
I still don't see why I would want it. Any project which includes a meson.build is super easy to just add as a submodule.
reply
> We have CMake which is wide-spread but garbage, and we have Meson which is pretty good but not as widely adopted

If it works for you use it. Just because meson looks very usable to you, it does not mean others have to adopt its opinionated bullshit and irrelevant approach.

Meson and Cmake are both there to solve user's problem, not expose users to all their dirty laundry dressed up as 'design approach'. Since both have their bullshit buckets full, it just depends on user's familiarity and personal preferences.

I dislike Cmake, and many years ago I watched videos of Pakkanen about build system design, and was impressed on what the video was conveying meson could do. Then I tried to implement meson on a firmware project. The project was still evolving, and the kind of babysitting and project reorg I had to do to pacify meson was more than the language bullshit that I had to deal with cmake. cmake has generator expressions and interfaces, so one could easily build for say stm32 and posix target with the same project tree. meson, if i remember, does not allow such config.

Long story short, went back to cmake, and with llm it is not even an issue. meson would be a non issue with llm too, but what surprised me the most was the theory of the videos by Pakkanen and the impl bullshit one had to deal with Meson on twisting the project into meson's well-of-wisdom. That might be one of the reasons why nobody adopts meson.

reply
> what we need is a decent standard build system, not a package manager

These are the same thing and the more you reject it the more you suffer

reply
Well they're not. Maybe they should be but they're not.

In JavaScript, NPM is a package manager. Build systems (Vite, Webpack, Browserify, ...) are separate.

In C++, we have vcpkg and Conan. Both are package managers, neither are build systems. I haven't used vcpkg but at least Conan integrates with Meson, CMake and other build systems.

A good build system (i.e not Make) has a clean concept of what a "package" is and how the dependencies between "packages" work. But a build system does not need to know how to download packages, it just needs to know what to do about them once it's pointed at a package. The problem with Conan is that it has to support a bunch of different build systems, so the definition of what a "package" is gets muddied.

reply
This is "the more you reject it the more you suffer" part

CMake and Meson both support package management. Conan also is a build system as much as a package manager. NPM is a build system, too. The degrees to which they try to pass off responsibility to other tools is why they suck.

> a clean concept of what a "package" is

First mistake: assuming you can define this. Good build systems/package managers don't define this at all, nor should they. It's natural for software developers to want to put limits here and try and box things in but it just makes life harder for everyone.

A build system orders individual operations that take inputs and yield outputs. That's it. This is what Make got right.

Package management is just an extension of that.

> a build system does not need to know how to download packages

Downloading is trivial. The actual package management part is checking hashes, version unification, and handling updates.

There's just no argument to me that these need to be separate tools, when bad tools wind up doing the same work poorly.

reply