Inherent code performance advantages of D over C?

Walter Bright newshound2 at digitalmars.com
Fri Dec 6 15:30:47 PST 2013


On 12/6/2013 3:06 PM, Maxim Fomin wrote:
> and what about holes in immutable, pure and rest type system?

If there are bugs in the type system, then that optimization breaks.

> C doesn't have virtual functions.

Right, but you can (and people do) fake virtual functions with tables of 
function pointers. No, C doesn't devirtualize those.

> By the way, does D devirtualize them?

It does for classes/methods marked 'final' and also in cases where it can 
statically tell that a class instance is the most derived type.



More information about the Digitalmars-d mailing list