Why many programmers don't like GC?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Thu Jan 14 09:26:06 UTC 2021
On Thursday, 14 January 2021 at 00:37:29 UTC, mw wrote:
> ok, what I really mean is:
>
> ... in other "(more popular) languages (than D, and directly
> supported by the language & std library only)" ...
Well, even Python supports both, if you want to, so... I suppose
you mean system level programming languages? The reality is that
GC for a system level programming language is not popular to
begin with. In that domain it is fairly common to not use the
standard library and use custom runtimes as we can see for C and
C++.
Anyway, what makes the D GC weak is exactly that there is not
much support for it in the D language or the compilers, only in
the runtime and the bare minimum of RTTI. LLVM support more
advanced GC features than D provides.
So, the D GC doesn't do much more for programmers than Boehm. And
Boehm is not popular either...
Oilpan, that Chrome uses has more advanced features than the D
GC, and does what most system level programmers want: limits it
to designated GC types and supports incremental collection. The
downside is that each Oilpan GC type also has to specify which
pointers to trace, but then again, not being able to do that in D
is a disadvantage...
For systems programming, I think D would be better off
appropriating the approach taken by Oilpan and mix it with
reference counting, but make it a language/compiler feature. That
is at least a proven approach for one big interactive
application. Basically make "D class" objects GC and everything
else RC or manual.
More information about the Digitalmars-d-learn
mailing list