Re:“What the Hardware Does” Is Not What Your Program Does: U...
by ralfjung on Monday July 15, 2019 @07:44AM
(#20439875)
I don't think I got any of it wrong, but in case I did I'd appreciate if you could point out my mistake(s). :)
[ Parent
| on HN ]
Re:“What the Hardware Does” Is Not What Your Program Does: U...
by saagarjha on Monday July 15, 2019 @11:42AM
(#20441884)
I talked a bit about it here: https://news.ycombinator.com/item?id=20435309. Basically, the compiler has no need to do things like perform reads in the face of undefined behavior: it could output an empty executable if it wished. Maybe your specific version of the compiler does, but that doesn't mean others (or even a future version of yours) will. Trying to figure out what a compiler might do in the face of undefined behavior is generally not a worthwhile exercise.
Re:“What the Hardware Does” Is Not What Your Program Does: U...
by ralfjung on Tuesday July 16, 2019 @08:25AM
(#20449384)
> Trying to figure out what a compiler might do in the face of undefined behavior is generally not a worthwhile exercise.
That is exactly the point of my post! If you think I disagree with that statement, we seriously miscommunicated somewhere.
The parts you seem to be concerned about are those where I try to explain why the abstract machine is the way it is. Hardware and compiler concerns do come in at that point, and my feeling is just dogmatically giving an abstract machine won't help convince people of its usefulness.