D vs C++ - Where are the benchmarks?

Jonathan M Davis jmdavisProg at gmx.com
Thu Jul 4 14:11:41 PDT 2013


On Thursday, July 04, 2013 23:04:09 Mehrdad wrote:
> On Thursday, 4 July 2013 at 21:03:01 UTC, Mehrdad wrote:
> > On Thursday, 4 July 2013 at 20:58:57 UTC, Jonathan M Davis
> > 
> > wrote:
> >> On Thursday, July 04, 2013 22:46:12 Mehrdad wrote:
> >>> How would you possibly be able to find the roots?
> >> 
> >> By putting all of the same information there that we have in
> >> D. It may be clunkier to do in D and generally more of a pain,
> >> but you have just as much control over memory in C++ as you do
> >> in D.
> >> And C++ GCs _do_ exist
> > 
> > Er, C++ _compilers_ that support (conservative?) GC's do exist.
> > 
> > But you can't write standard C++ code and expect it to
> > garbage-collect itself, you need external help that's not
> > guaranteed by the standard.
> > 
> > D, on the other hand, has a GC built into the language itself;
> > it's not an implementation detail.
> 
> To put it another way, _any_ conformant D compiler must
> necessarily have a GC.
> 
> On the other hand, C++ compiler aren't required to, so portable
> code can't assume they will.

Well, of course portable C++ code won't assume that you have a GC. My point 
was that it's perfectly possible to write C++ code which uses a GC, not that 
it was normal or easy.

- Jonathan M Davis


More information about the Digitalmars-d mailing list