Why many programmers don't like GC?

tsbockman thomas.bockman at gmail.com
Wed Jan 13 23:26:50 UTC 2021


On Wednesday, 13 January 2021 at 21:56:58 UTC, mw wrote:
> I think this flexibility to mix GC & manual memory management 
> is very unique in D. Actually I'm not sure if it can be done in 
> other languages at all.

Yes, this is one of the great things about D.

There are miscellaneous problems with the D runtime and the D 
standard library that make it harder than it needs to be, though. 
Improvements I would like to see in the future:

1) Finalize std.experimental.allocator

2) Good, safe, flexible reference counting module in the standard 
library (this requires further development of dip1000 and the 
like, I think).

3) Upgrade core.thread to fully support @nogc. I shouldn't lose 
access to Thread.sleep and the like just because a thread isn't 
being monitored by the GC.

4) Single-threaded versions of various components related to 
memory management that are more efficient because they don't need 
to be thread-safe. For example, people say that reference 
counting is slow because incrementing and decrementing the count 
is an atomic operation, but most references will never be shared 
between threads so it is just a waste to use atomics.

Still, all of these issues can be worked around today; D lacks 
high quality standards in this area more than it lacks necessary 
features.


More information about the Digitalmars-d-learn mailing list