D vs C++ - Where are the benchmarks?

Paulo Pinto pjmlp at progtools.org
Thu Jul 4 15:11:21 PDT 2013


Am 04.07.2013 23:20, schrieb Mehrdad:
> On Thursday, 4 July 2013 at 21:11:57 UTC, Jonathan M Davis wrote:
>> Well, of course portable C++ code won't assume that you have a GC.
>
>
> But portable D code will, so it really _is_ an advantage of the
> language, not just the compiler...
>
>
>> My point was that it's perfectly possible to write C++ code which uses
>> a GC, not that it was normal or easy.
>
> No, the point is that it would only with a particular C++ compiler.
> It's not "C++" code if a C++ compiler can't run it correctly.
> That would make it "a vendor-specific language similar to C++" code.

Yeah, it is called Managed C++ in .NET 1.x, C++/CLI starting in .NET 2.0 
and C++/CX in WinRT.

Managed C++ and C++/CLI can be JITed or compiled to machine code via 
NGEN. They make use of .NET GC for ref data types. There is a standard 
defined for C++/CLI, ECMA-372.

C++/CX compiles to native code, while making use of COM reference 
counting, the usual first level of GC algorithms.

--
Paulo




More information about the Digitalmars-d mailing list