If you could make any changes to D, what would they look like?

jmh530 john.michael.hall at gmail.com
Wed Oct 20 18:19:55 UTC 2021


On Wednesday, 20 October 2021 at 17:55:05 UTC, IGotD- wrote:
>> [snip]
>
> Correct, that is the drawback with different pointer types, 
> that you might need two implementations, one for pointers and 
> one for reference types. Normally generics takes care of that 
> pretty well.
>
> The benefit is that references/fat-pointers enables operations 
> under the hood that raw pointers don't allow. For example 
> increasing/decreasing a reference count. If everything in 
> Phobos/Druntime would use references instead of raw pointers 
> where applicable, the a recompile would have enabled a complete 
> change of the GC algorithm. Reference types enables more 
> versatility.

My limited knowledge of Managed C++ is that it only allowed the 
fat pointers with the GC. Would it be possible to have it 
customizable so that for instance you could have T^ work with a 
garbage collector or switch it out for reference counting?


More information about the Digitalmars-d mailing list