no-autodecode -- game plan

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Thu Aug 20 00:13:45 UTC 2020


On 8/19/20 10:12 AM, Steven Schveighoffer wrote:
> On 8/19/20 9:35 AM, Andrei Alexandrescu wrote:
>> Even the patch can reuse std.cmp if you pass std.cmp a range of code 
>> units so you undo its penchant to autodecode.
> 
> Here's what I actually did do:
> 
> https://github.com/dlang/phobos/blob/bf258e56f2dbc28cf810e9329a0696afbe114907/std/algorithm/comparison.d#L890-L895 

I have a number of strong objections to that, starting with the obvious 
fact that you add an undocumented symbol that the user interface then 
depends on. But that's not the main problem:

https://github.com/dlang/phobos/pull/7595#pullrequestreview-471042128

The main problem is we're butchering the entire standard library based 
on a `version` thing that essentially forks the entire library. THE 
ENTIRE LIBRARY. To change its semantics in ever so daintly ways. I have 
yet to see this anywhere else, ever. And THEN that stupid version flag 
gives carte blanche to anyone with a scalpel to keep on butchering, like 
this PR copiusly does:

https://github.com/dlang/phobos/pull/7595

This is a hack job. The version idea is awful. I told so Walter when he 
introduced it, he wouldn't listen.

Literally this is why we can't have good things.

IN THE NAME OF EVERYTHING GOOD, PLEASE STOP CHANGING.

PLEASE START ADDING.

> I fixed that bug, and in the process, handled both autodecoding and 
> nonautodecoding strings.
> 
> This brings "equal" outside of the domain of having to think about 
> autodecoding. If you have autodecoding enabled, it works. If you have it 
> disabled, it works. There is no need to have a separate equal function 
> in std.v2021. There is no need to call a separate equal function if you 
> want no-autodecoding, equal(someString, someOtherString) works no matter 
> what you care about autodecoding.
> 
> The more of this that we can do, the smaller the "drastic" change of 
> moving to non-autodecoding becomes.

This sounded nice this morning when I read it. Then during the day I had 
this growing feeling that the reality is much worse than that. I went to

https://github.com/dlang/phobos/pull/7595

which confirms my worst fear. This is a hack job that will butcher the 
standard library beyond recognition.

IN THE NAME OF EVERYTHING GOOD, PLEASE STOP CHANGING.

PLEASE START ADDING.


More information about the Digitalmars-d mailing list