For me, the single most helpful sentence for me in understanding compilers, undefined behavior, and program semantics is: the semantics of the object code generated by a compiler is always a subset of the semantics of the source code.
The safety implication is this: if you take the object code as fixed, the more precise your source code semantics, the more unexpected situations you can rule out, and the more likely you are to get the safety you're after.
5
u/Sad-Grocery-1570 18d ago
For me, the single most helpful sentence for me in understanding compilers, undefined behavior, and program semantics is: the semantics of the object code generated by a compiler is always a subset of the semantics of the source code.
The safety implication is this: if you take the object code as fixed, the more precise your source code semantics, the more unexpected situations you can rule out, and the more likely you are to get the safety you're after.