Blog: GC

Rumbu rumbu at rumbu.ro
Sat Mar 6 20:21:41 UTC 2021


On Saturday, 6 March 2021 at 01:33:00 UTC, NonNull wrote:
> Regarding the depressing GC blog article, dated 2021
>
> https://dlang.org/blog/2021/03/04/symphony-of-destruction-structs-classes-and-the-gc-part-one/
>
> At the foot it says
> Content Copyright © 2016-2018 by the D Language Foundation, All 
> Rights Reserved
>
> Easy to guess the current content about the GC. If a person 
> knows anything about the situation and has a small amount of 
> imagination, all of this is totally obvious. What a mess!
>
> Do we really have to reverse engineer the implementation to get 
> here? And a very incomplete reverse engineering indeed. The 
> blog's conclusion: The situation is bad, therefore avoid 
> interacting with it --- this is my first order approximation to 
> the article.
>
> So about D itself. No design here then, no intent, no 
> anticipation of the consequences of putting the pieces 
> together, no strategic reasoning about the consequences of the 
> construction of D with a garbage collector. All this long-ago 
> stuff is coming home to roost.
>
> The article admits it is incomplete. But what can follow except 
> workarounds if someone needs to get past this? And most won't 
> work. This is not just a roadblock. It reveals the entropy 
> inside D. The core of D is fatally flawed. D is not a language 
> where system garbage is taken care of, both concretely and 
> abstractly. The idea that we all system-program ourselves 
> around these difficulties suggests both labor and depression.
>
> So disappointed. I wanted D to win. But this is where the dirt 
> is, and I do not believe a strategic fix will ever be in the 
> works. Entropy rules.

I took the article with a grain of salt when I saw the author 
claiming that finalisation of classes is a problem in all garbage 
collected languages. It seems that the author failed to update 
himself or - what's worse - wants to justify D failure in having 
deterministic class destruction by pointing to others.

C# has IDisposable/using and Java has AutoCloseable as mechanisms 
for deterministic destruction.

I bet that the next article will end with the conclusion "use 
structs, classes are bad, you don't really need OOP, it's 
obsolete. But if you insist, here is our half baked library 
solution". I would be happy to be wrong on this.

If we want to be honest here, D failed to update/correct its OOP 
support, trying to please the C++ gang afraid of the garbage 
collector. I remember when D had built-in allocator support and 
delete for deterministic destructors. Now they are deprecated and 
we have a library solution :)




More information about the Digitalmars-d mailing list