No bounds checking for dynamic arrays at compile time?
Walter Bright
newshound2 at digitalmars.com
Thu Dec 13 13:26:15 PST 2012
On 12/13/2012 3:07 AM, bearophile wrote:
> I agree that putting lot of similar special cased tests in the compiler is a bad
> idea (also because code like $+$-$+1 is very uncommon).
> But can't the already present expression range analysis be used to cover some
> simple but common enough bugs?
I've seen no evidence that these are "common enough".
>> Since the bug is caught anyway, such is an extremely low priority because it's
>> got such a low payoff.
>
> If that's true then why aren't you programming in Python? :-) Spotting mistakes
> at compile time is usually better because the sooner you find bugs, the less
> problems they cause.
Although that is an advantage to static typing, it is hardly the only advantage.
Static typing has a tremendous advantage in generating high performance code.
More information about the Digitalmars-d
mailing list