News for hackers. Stuff that matters.
Re:Don’t assume that safety comes for free: a Swift case study by mikeash on Tuesday December 06, 2016 @10:29PM (#13120238)
If a language is going to have a default behavior, then it can't be a design choice that balances other considerations, because it has no idea what context it might be used in. The best option then is to default to safety, and allow the programmer to choose other behaviors if they need them.
Re:Don’t assume that safety comes for free: a Swift case study by ArkyBeagle on Wednesday December 07, 2016 @10:55PM (#13128311)
I think it's up to the end developers to decide that the behaviors are. You/I don't know that the best option is to default to "safety" - because we lack the information necessary to make that decision.

And yet again - this is UB because the original writers of the C language knew that the behavior of the hardware would be known to assembly programmers of the time.

Re:Don’t assume that safety comes for free: a Swift case study by mikeash on Thursday December 08, 2016 @09:48AM (#13130569)
You either have to pick a default, or you have to forbid developers from writing a + operation unless they first choose an overflow behavior. I can see arguments for the latter, but it's not a common choice.