←back to thread

1371 points yett | 3 comments | | HN request time: 0.756s | source
Show context
amenghra ◴[] No.43774928[source]
IMHO, if something isn’t part of the contract, it should be randomized. Eg if iteration order of maps isn’t guaranteed in your language, then your language should go out of its way to randomize it. Otherwise, you end up with brittle code: code that works fine until it doesn’t.
replies(11): >>43774993 #>>43775199 #>>43775210 #>>43775344 #>>43775361 #>>43775510 #>>43775759 #>>43776084 #>>43776311 #>>43776598 #>>43778608 #
1. roseway4 ◴[] No.43774993[source]
iirc, Go intentionally randomizes map ordering for just this reason.
replies(1): >>43775587 #
2. withinboredom ◴[] No.43775587[source]
Yep, and then you get crash reports you can’t reproduce.
replies(1): >>43780029 #
3. cristaloleg ◴[] No.43780029[source]
Same can be said about pointer addresses (random for each run). But ASLR exists for a specific reason.