DMD 2.100, bring ont he attribute soup

rikki cattermole rikki at cattermole.co.nz
Fri May 27 06:14:53 UTC 2022


On 27/05/2022 5:06 PM, Walter Bright wrote:
>> I want users of my libraries to be able to use my code without caring 
>> about stuff like memory lifetimes and be strongly likely to never hit 
>> an issue even with concurrency. I want the average programmer to be 
>> able to use my stuff without having to care about the little details.
> 
> The garbage collector does this famously.

I forgot to mention this in my other reply, when I talk about lifetimes 
I am not meaning about memory allocation/deallocation. That's a solved 
problem even if reference counting is not available on classes (we 
should do this but for other reasons).

What I care about is escape analysis, to make sure say an owning 
container, does not have a member of it escape its lifetime. Which of 
course would be bad, due to the fact that the data structure can 
deallocate it.

The problem I'm interested in here, is that the compiler guarantees that 
the order of destruction happens in the right order. This is something 
the GC does not do, but one that the compiler can and should be doing.

On that note, I've become quite a big fan of GC's for application code 
after studying memory management. For that reason I *really* want to see 
write barriers implemented as opt-in so that people can play around with 
implementing far more advanced GC's (since we are almost maxed out on 
what we can do without it).


More information about the Digitalmars-d mailing list