News for hackers. Stuff that matters.
Re:Hyrum's Law by cpeterso on Friday February 16, 2024 @07:38PM (#39404991)
One approach to guard against Hyrum’s Law is GREASE (aka “Generate Random Extensions And Sustain Extensibility” used in the TLS 1.3 protocol) i.e. behavior randomization to avoid inadvertent dependencies on unspecified behavior: https://textslashplain.com/2020/05/18/a-bit-of-grease-keeps-...

What are other approaches?

Re:Hyrum's Law by dgacmu on Friday February 16, 2024 @08:24PM (#39405365)
The Go hash table approach is similar to this: it's randomizedish but not strongly random enough to depend on it being actually random...

https://dev.to/wallyqs/gos-map-iteration-order-is-not-that-r...

(Which I find a hilarious second order example of Hyrum's law - if you add true randomness to prevent people from depending on the iteration order, they might use it as a way to randomly access items in the map!)

Re:Hyrum's Law by tialaramex on Friday February 16, 2024 @09:31PM (#39405769)
Matt Kulukundis (sp?) mentions this problem is his talk about Google's rather fancier Swiss tables.

At that point their debug builds would do a "coin toss" with 50.3% chance to be heads during hash table insertion and he expected some idiots would use that to generate random bits then be annoyed if it breaks. I believe in production it's entirely seeded from ASLR, so you're actually leaking address layout info if you try to use these bits as entropy instead of just to make the hash table defeat your bad unit tests.

Re:Hyrum's Law by jdoerrie on Saturday February 17, 2024 @04:08AM (#39407769)
Here's a link to that talk and mentioning of the 50.3%: https://youtu.be/ncHmEUmJZf4?t=2610
Re:Hyrum's Law by saghm on Saturday February 17, 2024 @01:30AM (#39406959)
This was mostly annoying because Go doesn't really provide any ordered map in std (and for while didn't give you generics, which are needed to make a general-purpose one that's perfomant). I feel like the best response to people relying on the order of iteration is to recognize that as a valid need an provide it via a separate type.
Re:Hyrum's Law by Retr0id on Saturday February 17, 2024 @03:15AM (#39407496)
There's also the Python approach, where dict() iteration became insertion-ordered as of Python 3.7+ (it was also ordered in 3.6, but only as an implementation detail, not as a language feature).

At the time I thought this was a questionable decision that'd cause nightmare debugging scenarios, where someone writes code accidentally depending on insertion-ordered iteration, only to deploy it on a python runtime without it (<=3.5). I'm sure this has happened to someone, but at least it hasn't happened to me.

Reference: https://stackoverflow.com/a/60775590

Re:Hyrum's Law by Hyrum_Website on Friday February 23, 2024 @09:59AM (#39481320)
Agreeing with kookamamie, yau8edq12i, and marliechiller

Hyrum and his dedicated self-proclaiming website reminded me of the gracelessness in the 3rd example of r/iamverysmart: Self-quoting

Re:Hyrum's Law by bboreham on Saturday February 17, 2024 @04:00AM (#39407732)
I have fixed a bug caused by this feature not being random enough.
Re:Hyrum's Law by jackblemming on Friday February 16, 2024 @08:08PM (#39405228)
Telling people who depended on probably internal behavior that wasn’t an explicit part of your contract to fuck off when they whine about you changing something.
Re:Hyrum's Law by salawat on Friday February 16, 2024 @11:20PM (#39406326)
You don't get to decide what is and isn't an implementation detail.

And lets be real. There is no contract, and any one that is made will inevitably be broken.

Re:Hyrum's Law by kazinator on Saturday February 17, 2024 @12:18AM (#39406648)
That depends entirely on the economics of the situation. Like who violates the contract, and how much business they represent.

Or other measure of their importance.

Does the C library change break a major distro? Or just some obscure program with three users?

Re:Hyrum's Law by summerlight on Saturday February 17, 2024 @12:52AM (#39406805)
When the clients have the power (e.g. a team that contributes to 90% of company's revenue), breaking the contract is often non-option from the beginning.
Re:Hyrum's Law by c0pium on Saturday February 17, 2024 @01:51AM (#39407047)
Ah yes, the “you’re holding it wrong” strategy.
[dead]
Re:Hyrum's Law by nkurz on Sunday February 18, 2024 @12:44AM (#39416538)
I tried to figure out how it credit it to you, but it was too complicated, so just I posted it here as me: https://news.ycombinator.com/item?id=39416277
Re:Hyrum's Law by tanx16 on Friday February 16, 2024 @09:22PM (#39405708)
Our team went with a similar approach when refactoring Protobuf debug APIs (https://bughunters.google.com/blog/6405366705946624/fixing-d...). People were relying on debug output and trying to parse it, so in the new implementation we threw up big warning flags and made the output unstable so that you couldn't make the mistake.

The key lesson to take away is: if you want something to be an implementation detail, make sure to have multiple differing implementations :)

Re:Hyrum's Law by kazinator on Saturday February 17, 2024 @12:13AM (#39406613)
[delayed]
Re:Hyrum's Law by waynesonfire on Saturday February 17, 2024 @12:17AM (#39406640)
> guard against Hyrum’s Law

Why bother? We're not even able to guard against well establish contracts from changing and breaking compatibility.

Re:Hyrum's Law by djha-skin on Saturday February 17, 2024 @11:00AM (#39410622)
Multiple implementations of the same interface.

When people don't know which implementation will be used, they tend to stick to the standard or the documentation.

We see this in places like the C language or in Common Lisp. Library writers must take into account that the implementation they use their library on may not be the same as the implementation their users will use.