The easiest way to compete with Rust and cure D's GC reputation: switch to ARC.

Dukc ajieskola at gmail.com
Sat Jul 12 21:36:18 UTC 2025


On Friday, 11 July 2025 at 20:18:59 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> As a topic supporting ARC style memory management has long 
> since been discussed. This isn't a new idea.
>
> For ARC at the language level to exist, it requires that all 
> memory in D would have to have a predictable state access. For 
> example with a slice, not only do you need a pointer, length, 
> but also the state object.

Well not quite.

The reference count for ARC allocations would presumably exist in 
the runtime registry, not in the allocated object itself. Just 
like runtime type information does for garbage collected 
allocations.

Storing the ref count along the object would likely perform 
better, but don't think it would be done like that in D because 
the same reference types are used to deal with objects allocated 
in C.


More information about the dip.ideas mailing list