News for hackers. Stuff that matters.
Re:C++23: Removing garbage collection support by moralestapia on Wednesday November 01, 2023 @12:35PM (#38100804)
>What does this have to do with the article?

Did you read it? It's about GC in C++ being a relative obscure feature that is now going to be removed.

>some pedantic argument you made 4 years ago

I just shared an anecdote related to it and I thought it'd be appropriate bc. this is/was quite likely the only chance I'd have in my life to talk about this very very very specific situation with people that would understand it. And yes, it's getting a few upvotes, weird thing to be mad at but to each its own.

Re:C++23: Removing garbage collection support by skitter on Wednesday November 01, 2023 @12:49PM (#38101051)
It was in the spec but never implemented, so it's obly a feature of C++ if you take the stance that there are no real implementations of C++.
Re:C++23: Removing garbage collection support by TeMPOraL on Wednesday November 01, 2023 @12:55PM (#38101134)
If you want to go this way, then take a look at compiler support matrix for last few language versions - if having an implementation is necessary for something in spec to "be a feature of C++", then C++20 and C++23 are still missing some features they're supposed to have.
Re:C++23: Removing garbage collection support by pjmlp on Wednesday November 01, 2023 @01:26PM (#38101633)
Several features in ISO are yet to be fully implemented, there are compilers still catching up with C++17.

GC isn't the first one to victim of such lack of implementations, only EDG implemented C++98 external templates, for example.

Re:C++23: Removing garbage collection support by pbsd on Wednesday November 01, 2023 @02:46PM (#38102996)
extern templates are a C++11 feature. export templates are the removed C++98 feature.
Re:C++23: Removing garbage collection support by pjmlp on Wednesday November 01, 2023 @04:13PM (#38104359)
Thanks for the correction, I meant obviously export templates.
Re:C++23: Removing garbage collection support by moralestapia on Wednesday November 01, 2023 @12:55PM (#38101132)
IIRC it was present in Clang back at the time (which was relevant to us as we were using it); not sure about gcc or others.
Re:C++23: Removing garbage collection support by Kranar on Wednesday November 01, 2023 @02:58PM (#38103192)
We should be clear, GC was never a feature in C++.

What these features do, which are being removed, is make it easier to implement a GC allocator in a standard conforming and portable fashion. Current GCs in C++, such as Boehm's GC, depend on platform specific hacks that are incredibly brittle.

As it turns out, these features do not make it easier to actually implement a GC allocator in C++, so they are being removed.

I think most people can differentiate between a language providing a feature as a first class native property, and a library or feature built on top of that language. Most people would not argue against the position that C++ does not contain a web browser as a feature, even though it's possible to build a web browser using C++.

Similarly, C++ does not and has never had garbage collection, but for a time the standard did provide facilities that was supposed to make it easier to implement a garbage collection library.