-
-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[do not merge] trigger deprecation warnings for auto-decoding #4384
Conversation
|
I, personally, support this approach, but I think @andralex is set to veto it:
I'm not sure why he says "there's no realistic way to eliminate it from D": supposing that we all agreed that auto-decoding is a bad thing, is there any reason we can't just permanently deprecate it - but never actually remove it? I think that would neatly solve any concerns about 10-year-old code silently changing in behaviour down the line, and it's not like we need to free up the deprecated template signatures for some other use. |
|
On Mon, May 30, 2016 at 06:23:23PM -0700, tsbockman wrote:
Andrei is wrong. We can all see it, and maybe if we demonstrate that a migration path is possible, even actually pretty easy following a simple deprecation path, maybe he can see it too. |
| @@ -2057,7 +2057,12 @@ version(unittest) | |||
| static assert(!is(typeof({ void[] a; popFront(a); }))); | |||
| } | |||
|
|
|||
| enum stringDeprecationMsg = "Unicode string require explicit iteration." ~ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"string require" should be "strings require" or "string requires"
"explicit iteration." should be " the range element type to be specified explicitly: "
94bafe0
to
18daa2a
Compare
|
@wilzbach thanks for running this experiment.
Definitely wouldn't be the first time and not the last.
I'm not sure who "all" is but that's beside the point. Taking a step back, we'd take in a change that breaks Phobos in 132 places only if it was a major language overhaul bringing dramatic improvements to the quality of life for D programmers. An artifact as earth shattering as ranges, or an ownership system that was massively simple and beneficial. For comparison, the recent changes in name lookup broke Phobos in fewer places (I don't have an exact number, but I think they were at most a couple dozen.) Those changes were closing an enormous hole in the language and mark a huge step forward. I'd be really hard pressed to characterize the elimination of autodecoding as enough of an improvement to warrant this kind of breakage. (I do realize there's a difference between breakage and deprecation, but for many folks the distinction is academic.) The better end game here is to improve efficiency of code that uses autodecoding (e.g. per the recent |
|
One more thing: a possible additional outcome of this experiment would be to append |
That would be just about every single person who participated in the recent forum thread, except you - including a goodly percentage of all currently active D contributors.
Phobos is naturally more effected by this change than typical user code will be, because Phobos exists to abstract over a lot of the kind of low-level text operations that might need to work with code units. Also, 132 really isn't much at all considering how trivial the fix is, and how large Phobos is.
Indeed, this change breaks nothing; it is effectively just a way of warning the user that his code might not be doing what he thinks it does.
This change would:
|
|
I think # of breakages in Phobos is a poor metric of how much we will break user code, for the simple reason that Phobos contains the implementation of autodecoding. A more interesting (and accurate) test would be to test dub packages on code.dlang.org, for example. |
|
I understand that this PR's test results can be used to track Phobos' reliance on auto decoding, which I understand we've agreed is a non-controversial first step away from auto-decoding. Should I reopen it for that purpose, then? |
Just a proof of concept PR that shows how auto-decoding could be deprecated.
Same goes for the deprecation message.
I added deprecation warning for narrow strings their range primitives (
front,popFront,backandpopBack) based on @adamdruppe's proposal.We only have to fix 132 locations
Happy fixing!