assert semantic change proposal

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 5 01:35:03 PDT 2014


On Monday, 4 August 2014 at 03:22:51 UTC, Andrei Alexandrescu 
wrote:
> Efficiency is hard to come by and easy to waste.

It's perfectly understandable, why one would want unsafe 
optimizations, and D already has the way to provide unsafe 
features: safe is default, unsafe is possible when requested 
explicitly. I'd say -Ounsafe switch would be good, it would 
enable various unsafe optimizations; other examples are fast math 
and no signed overflow assumption. They just shouldn't be forced 
on everyone, then you will get the upside you want and others 
won't get the downside they didn't want.

Efficiency is not very hard: currently `assert` is not the most 
prominent direction of optimizations, I'd recommend to improve 
inlining and deep inlining of ranges so that they will become as 
fast as hand-written cycles or even faster. That would be much 
more beneficial. Or ask bearophile, he can have more ideas for 
very beneficial optimizations, or ask everyone.


More information about the Digitalmars-d mailing list