The Case Against Autodecode

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 17:45:35 PDT 2016


On 05/31/2016 01:23 PM, Andrei Alexandrescu wrote:
> On 05/31/2016 01:15 PM, Jonathan M Davis via Digitalmars-d wrote:
>> The standard library has to fight against itself because of autodecoding!
>> The vast majority of the algorithms in Phobos are special-cased on
>> strings
>> in an attempt to get around autodecoding. That alone should highlight the
>> fact that autodecoding is problematic.
>
> The way I see it is it's specialization to speed things up without
> giving up the higher level abstraction. -- Andrei

Problem is, that "higher"[1] level abstraction you don't want to give up 
(ie working on code points) is rarely useful, and yet the default is to 
pay the price for something which is rarely useful.

[1] It's really the mid-level abstraction - grapheme is the high-level 
one (and more likely useful).



More information about the Digitalmars-d mailing list