Major performance problem with std.array.front()

Shammah Chancellor anonymous at coward.com
Fri Mar 7 04:09:27 PST 2014


On 2014-03-07 04:17:34 +0000, Walter Bright said:

> On 3/6/2014 7:59 PM, bearophile wrote:
>> Walter Bright:
>> 
>>> I understand this all too well. (Note that we currently have a different
>>> silent problem: unnoticed large performance problems.)
>> 
>> On the other hand your change could introduce Unicode-related bugs in future
>> code (that the current Phobos avoids) (and here I am not talking about code
>> breakage).
> 
> This comes up repeatedly as justification for D trying to hide the 
> UTF-8 nature of strings that I discussed upthread.
> 
> To my mind it's like trying to pretend that floating point doesn't have 
> roundoff issues, integers have infinite range, memory is infinite, etc. 
> That has a place in other languages, but not in a systems/native 
> language.

Is it possible to add a warning notice when .front() is used on char?  
I would say fix it now, add a warning, and then remove the warning 
later.

-S.



More information about the Digitalmars-d mailing list