How to improve autodecoding? (Was: The Case Against Autodecode)

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 11:21:45 PDT 2016


On Monday, May 30, 2016 14:24:23 Andrei Alexandrescu via Digitalmars-d wrote:
> On 05/30/2016 12:34 PM, Jack Stouffer wrote:
> > On Monday, 30 May 2016 at 16:25:20 UTC, Nick Sabalausky wrote:
> >> D1 -> D2 was a vastly more disruptive change than getting rid of
> >> auto-decoding would be.
> >
> > Don't be so sure. All string handling code would become broken, even if
> > it appears to work at first.
>
> That kind of makes this thread less productive than "How to improve
> autodecoding?" -- Andrei

I think that the first step is getting Phobos to work with all ranges of
character types - be they char, wchar, dchar, or graphemes. Then the
algorithms themselves will work whether we have auto-decoding or not. With
that done, we can at minimum tell folks to use byCodeUnit, byChar!T,
byGrapheme, etc. to get the correct, efficient behavior. Right now, if you
try to use ranges like byCodeUnit, they work with some of Phobos but not
enough to really work as a viable replacement to auto-decoding strings.

With all that done, at least it should be reasonably easy for folks to
sanely get around auto-decoding, though the question still remains at that
point how possible it will be to remove auto-decoding and treat ranges of
char the same way that byCodeUnit would. But at bare minimum, it's what we
need to do to make it possible and reasonable to work around auto-decoding
when you need to while specifying the level of Unicode that you actually
want to operate at.

- Jonathan M Davis



More information about the Digitalmars-d mailing list