News for hackers. Stuff that matters.
Re:Go will use pdqsort in next release by setr on Thursday April 21, 2022 @02:40AM (#31106599)
If you ignore the stated guarantees of the API and depend on implementation details instead, then it’s on you? I might understand if it were unstated, but it explicitly states it’s not.

Otherwise the only way to have a non-stable sort function that currently happens-to-be stable would have to include a randomized shuffle afterwards to ensure no one goes around depending on it…

It would be equivalent to assuming the golang ABI was stable because it survived unmodified for a couple versions, despite it being explicitly not. And then freezing the ABI to maintain a guarantee it explicitly didn’t want to maintain.

Re:Go will use pdqsort in next release by Someone on Thursday April 21, 2022 @03:37AM (#31106888)
> if you ignore the stated guarantees of the API and depend on implementation details instead, then it’s on you?

In theory, yes. In practice, if a OS or library update uncovers bugs in many programs, that update won’t get favorable reviews.

That’s the reason behind Linux’s “we do not break userspace!” rule (https://linuxreviews.org/WE_DO_NOT_BREAK_USERSPACE), and also why Microsoft Windows has layer upon layer of APIs, a copy of the Windows 95 memory manager (https://mcpmag.com/articles/2010/07/27/trip-down-memory-lane...), why large databases support character sets that probably haven’t been used anywhere since before many HN readers were born (https://docs.oracle.com/goldengate/1212/gg-winux/GWUAD/wu_ch...), etc.

(Apple has a totally different viewpoint on this. That’s one reason it never really got into businesses for a long time)

Re:Go will use pdqsort in next release by samus on Thursday April 21, 2022 @01:16PM (#31112313)
Linus' rule also has disadvantages as it blocks real innovation in the Linux ecosystem. Granted, Desktop Linux doesn't need another Python 2 -> 3 or X.org -> Wayland deathmarch...
Re:Go will use pdqsort in next release by ElectricalUnion on Thursday April 21, 2022 @09:22PM (#31117190)
> Linus' rule also has disadvantages as it blocks real innovation in the Linux ecosystem.

Block real innovation like what?

> Granted, Desktop Linux doesn't need another Python 2 -> 3 or X.org -> Wayland deathmarch...

That's all userspace? Userspace doesn't care it breaks. That's why userspace sucks. You need to keep compatibility if you want to have a stable base to build something. That's why we have (sometimes silly) standards like SUS or POSIX.

"we do not break userspace" at least garantees that you need to fix only the userspace, and not the whole thing all the time.

Re:Go will use pdqsort in next release by samus on Friday April 22, 2022 @03:50AM (#31119270)
Breakages of userspace are almost always unintended consequences. I don't have examples to the contrary, but I believe that intentional breakages and redesigns are almost unthinkable because of Linus's rule.

Significant changes in the kernel already often need years to land because of the multitude of configurations and interfaces that have to be supported. And even longer to deprecate and remove. Not necessarily a bad thing, just the price of success.

Large-scale breakages like the Wayland transition affect the whole Desktop Linux ecosystem, and are just an example of what mayhem fundamental changes can cause.

Re:Go will use pdqsort in next release by remus on Thursday April 21, 2022 @03:32AM (#31106859)
While I totally agree with the sentiment it is nice when language developers go out of their way to not break stuff, even when they don't have to. For example the golang team have made efforts not to break certain usages of the unsafe package in the past, despite the package offering no guarantees about stability.

On a similar note, Im sure there was a suggestion to artificially make the previous golang sort function unstable so that users wouldn't come to rely on stable behaviour where it wasn't guaranteed. I quite like the idea, start the fight against hyrum's law!