Please be more careful when changing the language behavior

Avrina avrina12309412342 at gmail.com
Tue Jun 2 03:20:34 UTC 2020


On Monday, 1 June 2020 at 19:38:30 UTC, Johan wrote:
> Hi all,
>   Please be more careful when changing the language behavior.
>
> The change made by https://github.com/dlang/dmd/pull/9289 
> silently breaks code in ways that can be very hard to detect. 
> We were lucky to detect one case. There is no 
> warning/deprecation whatsoever to warn me about any other 
> potential breakages in a heavily templated 400kloc codebase 
> with 212 instances of alias this.
>
> The breakage introduced was very obvious, and warning about it 
> is not difficult either. We need to raise the bar for accepting 
> changes like this. The code on buildkite project tester is 
> (fortunately) not the only D code in the world.
>
> Again, please be more careful when changing language behavior.
>
> Thanks,
>   Johan

It appears they tried to come to some sort of plan as to what 
should be done to notify the user. Not very inspiring that Walter 
was pinged and he didn't leave any feedback other than a ✔.

I don't think a "simple" warning would have worked. That's a 
warning that would then have to be manually disabled all the 
time. It could have been put under the deprecation flag, but 
still then you'd be flooded with warnings that can't be "fixed" 
if someone treats deprecations as errors.

This is where it would be nice to have a different versioning 
scheme than what we have now. You could put breaking changes like 
these where it's difficult to nicely notify the user. These 
change could have been deferred to a major version, where 
potentially breaking changes could be listed so that they can be 
checked. Then include a flag that does check if a code base uses 
that pattern anywhere so it can be fixed. A flag like that 
wouldn't work now as people expect their code to just work. 
There's only one version of D. They would most likely miss this 
breaking change, especially since it doesn't appear to have been 
added to any of the subsequent change logs. Which would help a 
user, if they did update up a few versions and don't have the 
time to read everything. There is a lot that could have been done 
better for sure.




More information about the Digitalmars-d mailing list