How usable is the D language without a garbage collector?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Jul 17 11:52:46 UTC 2022


On Sunday, 17 July 2022 at 09:27:03 UTC, Siarhei Siamashka wrote:
> Modern C compilers are "undermining what C tries to achieve" 
> too. GCC has '-fwrapv' option for wrapping signed ints and 
> '-ftrivial-auto-var-init=' option for preventing variables from 
> being accidentally left uninitialized.

C-compilers have a gazillion of options, but the advantage of 
having zero-initialisation of heap allocated arrays is that you 
can bypass initialization if your memory manager zeros out memory 
for you.


> There's also '-fno-strict-aliasing' option for eliminating the 
> root cause of a certain class of hard to debug problems. All of 
> this together forms a kind of somewhat safer non-standard C 
> dialect, which is still fully compatible with the existing C 
> code.

This is necessary because of existing (old) type punning practice.




More information about the Digitalmars-d mailing list