News for hackers. Stuff that matters.
Re:Free-threaded CPython is ready to experiment with by yosefk on Friday July 12, 2024 @05:13PM (#40949500)
If Python's dependency management is better than anything, it's better than C++'s. Python has pip and venv. C++ has nothing (you could say less than nothing since you also have ample opportunity for inconsistent build due to mismatching #defines as well as using the wrong binaries for your .h files and nothing remotely like type-safe linkage to mitigate human error. It also has an infinite number of build systems where each system of makefiles or cmakefiles is its own build system with its own conventions and features). In fact python is the best dependency management system for C++ code when you can get binaries build from C++ via pip install...
Re:Free-threaded CPython is ready to experiment with by andmkl on Friday July 12, 2024 @08:04PM (#40950578)
C++ has apt-get etc. because the libraries do not change all the time. Also, of course there are vcpkg and conan.

Whenever you try to build something via pip, the build will invariably fail. The times that NumPy built from source from PyPI are long over. In fact, at least 50% of attempted package builds fail.

The alternative of binary wheels is flaky.

Re:Free-threaded CPython is ready to experiment with by viraptor on Saturday July 13, 2024 @01:11AM (#40951921)
> C++ has apt-get

That's not a development dependency manager. System package management is a different kind of issue, even if there's a bit of overlap.

> because the libraries do not change all the time

That's not true in practice. Spend enough time with larger projects or do some software packaging and you'll learn that the pain is everywhere.

Re:Free-threaded CPython is ready to experiment with by wiseowise on Friday July 12, 2024 @06:01PM (#40949846)
> If Python's dependency management is better than anything, it's better than C++'s.

That’s like the lowest possible bar to clear.

Re:Free-threaded CPython is ready to experiment with by yosefk on Saturday July 13, 2024 @04:00AM (#40952563)
Agreed, but that was the bar set by the comment I was replying to, which claimed Python doesn't clear it.
Re:Free-threaded CPython is ready to experiment with by vulnbludog on Saturday July 13, 2024 @05:30AM (#40952869)
On bro
Re:Free-threaded CPython is ready to experiment with by stavros on Friday July 12, 2024 @07:07PM (#40950282)
That was the entire point, that C++ is the absolute worst.
Re:Free-threaded CPython is ready to experiment with by dgfitz on Friday July 12, 2024 @09:02PM (#40950902)
I pip3 installed something today. It didn’t work, at all.

I then yum installed a lib and headers, it worked well.

C++ on an msft platform is the worst. I can’t speak for Mac. C++ on a linux is quite pleasant. Feels like most of the comments like yours are biased for un-stated reasons.

Re:Free-threaded CPython is ready to experiment with by stavros on Friday July 12, 2024 @09:05PM (#40950915)
If I had a penny for every time I gave up on compiling C++ software because there's no way to know what dependencies it needs, I'd be a millionaire. Python at least lists them.
Re:Free-threaded CPython is ready to experiment with by dgfitz on Friday July 12, 2024 @09:35PM (#40951071)
If I had a penny every time I heard something like that on sites like this, I’d be a billionaire :)
Re:Free-threaded CPython is ready to experiment with by ahartmetz on Saturday July 13, 2024 @04:40AM (#40952677)
Is that because the compiler failed with "foo.h not found" or the build system said "libfoo not found"? CMake is most common and it will tell you. Worst case it's difficult to derive the package name from the name in the diagnostic.

It's not great, but usually not a big deal neither IME. Typically a couple of minutes to e.g. find that required libSDL2 addon module or whatever, if there is that kind of problem at all.

Re:Free-threaded CPython is ready to experiment with by stavros on Saturday July 13, 2024 @05:53AM (#40952957)
Yes it is, and it's usually such a big deal for me that I just don't use that software. I don't have time to go through a loop of "what's the file name? What package is it in? Install, repeat". This is by far the worst experience I've had with any language. Python has been a breeze in comparison.
Re:Free-threaded CPython is ready to experiment with by dgfitz on Saturday July 13, 2024 @09:07AM (#40953902)
I’m not going to refute your points. If you’re going to wear rose-tinted glasses about all of the bad parts about python, that’s fine, I also like python.
Re:Free-threaded CPython is ready to experiment with by stavros on Saturday July 13, 2024 @09:08AM (#40953904)
What's rose-tinted about "one of them downloads dependencies automatically, the other one doesn't"?
Re:Free-threaded CPython is ready to experiment with by cozzyd on Saturday July 13, 2024 @04:44PM (#40956740)
I mean this is a documentation problem. It's pretty common for python to import something it doesn't say it depends on too, btw...
Re:Free-threaded CPython is ready to experiment with by viraptor on Saturday July 13, 2024 @01:15AM (#40951938)
This has nothing to do with languages. You can yum install python packages and expect them to work fine. You can install C++ files using an actual dependency manager like vcpkg or conan and have issues.

You're pointing out differences between software package management styles, not languages.

Re:Free-threaded CPython is ready to experiment with by ansgri on Sunday July 14, 2024 @08:31AM (#40960565)
C++ on linux is indeed pleasant if you use only distro-provided library versions. Some specialized library with specific version, also no big deal. Need some upgraded version of a widely-used library -- get containerized or prepare for real pain.
Re:Free-threaded CPython is ready to experiment with by npalli on Sunday July 14, 2024 @10:52AM (#40961297)
Have you tried vcpkg on msft (work on linux and mac too btw)? I found it to be much better than pip3 and venv nonsense.