News for hackers. Stuff that matters.
Re:All C++20 core language features with examples by mackal on Wednesday April 07, 2021 @10:54AM (#26725812)
I actually extremely dislike language specific package managers. I'm on Linux, the packages should be in my package manager. I don't want to maintain multiple package managers. nmp is actually the worst here.
Re:All C++20 core language features with examples by quacker on Wednesday April 07, 2021 @01:55PM (#26728397)
> I actually extremely dislike language specific package managers. I'm on Linux, the packages should be in my package manager. I don't want to maintain multiple package managers. nmp is actually the worst here.

As a user of software that doesn't care how it's built, sure. But system package managers are not a solution for general development with C++, or any other language.

If I want to use C or C++ to create software, how do I use libraries that aren't available in a system package manager? What if I need a version of a library that's not available in my system package manager? There are answers here but they aren't good answers (build from source, using whichever of N build tools the project happens to use, or hope there are prebuilt libs hosted somewhere)

Relying on system package managers to contain dependent libraries makes cross-platform development a complete PITA (more that it already is). Now you need the specific versions of all your libraries in package managers on all platforms, which is a complete non-solution for real development.

Re:All C++20 core language features with examples by otabdeveloper4 on Wednesday April 07, 2021 @03:21PM (#26729740)
The problem is more or less solved - see Nix.

It'll take some decades for the ideas to percolate, but language-specific package managers are definitely not the future.

Re:All C++20 core language features with examples by quacker on Wednesday April 07, 2021 @04:23PM (#26730676)
> The problem is more or less solved - see Nix.

Sorry, but I'm really not sure what you mean by "solved".

Nix is yet another (language agnostic) package manager with certain tradeoffs. But, if there is not an available Nix package for a specific version of a library I need to use - I'm out of luck.

Nix is not a build tool designed to work with arbitrary or latest development versions of libraries, for example. And, it will never solve that problem even _if_ it is technically capable of doing so - because there is no force in the world that would get all projects in all languages to use it.

Re:All C++20 core language features with examples by otabdeveloper4 on Thursday April 08, 2021 @03:37AM (#26736087)
> Nix is not a build tool designed to work with arbitrary or latest development versions of libraries, for example.

No, that's exactly what it's designed for and exactly how we use it. And it's not a build tool (it just calls your existing build tools under the hood), it's a system for keeping different versions of dependencies installed at the same time without errors.

> because there is no force in the world that would get all projects in all languages to use it.

You can write your own wrappers for the projects that are missing. It's a simple and idiomatic process.

Re:All C++20 core language features with examples by ris on Wednesday April 07, 2021 @07:07PM (#26732747)
> Nix is not a build tool designed to work with arbitrary or latest development versions of libraries, for example

Well it sort of is and it sort of isn't. The great thing about Nix is how the provided packages remain malleable. You can usually quite easily make a small override to a provided package to make it build from a specific revision of the source you desire, or add a custom patch, and Nix will just build it all for you then & there. Then you can go and rebuild bits of the rest of the distribution that depend on that using your custom version. If you so want.

Re:All C++20 core language features with examples by hpb42 on Wednesday April 07, 2021 @02:26PM (#26728890)
Exactly.

Also, i'm terrified of this idea of "library-manager download code from internet and run on this machine", without all the tests and QA of individual dependencies like we have in Linux packages.

Also, i've seen so many times people adding dependencies to projects because they did not know the standard library already had what they needed. I get it, it is easier to "pip install foo" than to look for "foo" in the docs. I don't think any sane person can learn everything that is available in the standard library, but searching the docs is always insightful.

Re:All C++20 core language features with examples by pornel on Wednesday April 07, 2021 @07:16PM (#26732848)
The problem is that system-specific package managers are an obstacle to making portable programs.

Even within Linux and BSD there are many flavours of package managers with slightly different naming schemes for their packages.

This fragmentation makes it impossible to have dependencies that just work. You need to either make users install things manually or every author has to probe multiple package names/locations using multiple tools.

Language-specific managers support all of the OSes and just work, especially for users of macOS and Windows (telling people their OS sucks may state a true fact, but doesn't solve portability problems)

Re:All C++20 core language features with examples by Ar-Curunir on Wednesday April 07, 2021 @11:42AM (#26726531)
The Linux model of package management doesn't work for newer languages. In particular it is heavily reliant on dynamic linking, which tends not to work when you have (a) an unstable ABI (b) generics (c) a culture of static linking.
Re:All C++20 core language features with examples by beojan on Wednesday April 07, 2021 @01:03PM (#26727676)
It works fine, you just ship the static libraries. With static linking your binaries won't have dependencies anyway.

That's not to say the static linking craze is a good thing. We'd be far better off finding a way to dynamically link templates, so you get the security benefits of automatically updated dependencies that dynamic linking gives you.

Re:All C++20 core language features with examples by gowld on Wednesday April 07, 2021 @12:02PM (#26726848)
Code library managers don't belong inside OS package managers (because you want hermetic builds), unless maybe you have some Nix-live multi-manager that can provide many environments.
Re:All C++20 core language features with examples by Koshkin on Wednesday April 07, 2021 @11:29AM (#26726321)
Great point. I think BSDs got this right with their ports. (Incidentally, NetBSD's pkgsrc supports Linux.)