Unicode handling comparison

Walter Bright newshound2 at digitalmars.com
Thu Nov 28 01:02:02 PST 2013


On 11/27/2013 9:22 AM, Jakob Ovrum wrote:
> In D, we can write code that is both Unicode-correct and highly performant,
> while still being simple and pleasant to read. To write such code, one must have
> a modicum of understanding of how Unicode works (in order to choose the right
> tools from the toolbox), but I think it's a novel compromise.

Sadly, std.array is determined to decode (i.e. convert to dchar[]) all your 
strings when they are used as ranges. This means that all algorithms on strings 
will be crippled as far as performance goes.

http://dlang.org/glossary.html#narrow strings

Very, very few operations on strings need decoding. The decoding should have 
gone into a separate layer.


More information about the Digitalmars-d mailing list