C++, D: Dinosaurs?

Walter Bright newshound1 at digitalmars.com
Sat Nov 15 20:37:55 PST 2008


bearophile wrote:
> Tony:
>> Walter Bright:
>>> 1. GC programs can be faster 2. GC programs can use less memory 
>>> 3. GC programs can be guaranteed to be memory safe 4. GC programs
>>> are faster to develop and have fewer bugs
> So even taking into account that Walter's experience on such topics
> is far greater than mine (I've never written a GC for C++, for
> example), I'd risk say that in general point 2 is wrong.

When people do benchmarks comparing the same code in explicit allocation 
and GC, the GC uses more memory. However, and this is a big however, the 
existence of GC means you can structure your algorithm to need far fewer 
allocations. Kris Bell's talk on that at the last D conference was a 
prime example of that.

For example, with GC you can slice an existing string. With manual mm, 
you have to allocate memory and copy it.



More information about the Digitalmars-d mailing list