Why not flag away the mistakes of the past?

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Mar 8 17:35:11 UTC 2018


On Thu, Mar 08, 2018 at 10:14:16AM -0700, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, March 08, 2018 16:34:11 Guillaume Piolat via Digitalmars-d 
> wrote:
[...]
> > I'd agree with you, hate the special casing. However it seems to
> > me this has been debated to death already, and that auto-decoding
> > was successfully advocated by Alexandrescu and al; surviving the
> > controversy years ago.
> 
> Most everyone who debated in favor of it early on is very much against
> it now (and I'm one of them). Experience and a better understanding of
> Unicode has shown it to be a terrible idea. I question that you will
> find any significant contributor to Phobos who would choose to have it
> if we were starting from scratch, and most of the folks who post in
> the newsgroup agree with that.
[...]

Yeah, the only reason autodecoding survived in the beginning was because
Andrei (wrongly) thought that a Unicode code point was equivalent to a
grapheme.  If that had been the case, the cost associated with
auto-decoding may have been justifiable.  Unfortunately, that is not the
case, which greatly diminishes most of the advantages that autodecoding
was meant to have.  So it ended up being something that incurred a
significant performance hit, yet did not offer the advantages it was
supposed to.  To fully live up to Andrei's original vision, it would
have to include grapheme segmentation as well.  Unfortunately, graphemes
are of arbitrary length and cannot in general fit in a single dchar (or
any fixed-size type), and grapheme segmentation is extremely costly to
compute, so doing it by default would kill D's string manipulation
performance.

In hindsight, it was obviously a failure and a wrong design decision.
Walter is clearly against it after he learned that it comes with a hefty
performance cost, and even Andrei himself would admit today that it was
a mistake.  It's only that he, understandably, does not agree with any
change that would disrupt existing code. And that's what we're faced
with right now.


T

-- 
Frank disagreement binds closer than feigned agreement.


More information about the Digitalmars-d mailing list