Re:Hunt: A high-level D Programming Language Web framework
by gnulinux on Monday May 04, 2020 @05:33PM
(#23073577)
The alternative of gc is not malloc and free. It's custom memory management, i.e. the code that decides when to execute malloc and when to execute free. Even a gc will ultimately call the equivalent of malloc or free. The difference is gc needs to do it generic enough that it works for all possible programs; whereas a programmer needs to do it in a way it works for this particular program.
[ Parent
| on HN ]
Re:Hunt: A high-level D Programming Language Web framework
by pjmlp on Tuesday May 05, 2020 @05:39AM
(#23078171)
Many GC languages like D offer the tooling to decide where to allocate as well, it is not GC for everything.
GC, untraced references, reference counting, stack and global memory segment allocations, OS system buffers.
The programmer also needs to do it in a way that works for a particular program instead of doing new everywhere.
The advantage being that having a GC around is much more productive for the workflows that don't need such hand tuning.