3 ms·
If it's so difficult to figure out if the consequences of their optimization game are sensible or not, then they shouldn't play it in the first place. Who actu
by _dain_ 3y ago
If it's so difficult to figure out if the consequences of their optimization game are sensible or not, then they shouldn't play it in the first place.
Who actually wants it to behave this way, other than compiler engineers competing on microbenchmarks? Who is this language even for?
- layer8 3y agoIt’s a side effect of desirable optimizations for UB-free code. You can’t have both at the same time.
- _dain_ 3y agoDesirable for whom? Are the beneficiaries of it going to pay for the externalities they are generating, like polluters should? You can say "ordinary workaday programmers benefit from speed improvements en passant", but they weren't really given a choice in the matter, were they? When programmers are given an explicit binary choice of "correct, but slightly slower", and "wrong, but slightly faster", they pick the former in practically all cases (or they should, at any rate). But they can't make this choice; the compiler and spec writers go behind their backs and construct these inscrutable labyrinths, then blame everyone else for getting lost in them.
- aidenn0 3y ago-fwrapv is there for people to use. People don't use it. Yes defaults matter, but they matter both ways. People benchmark with the default options and a compiler with -fwrapv turned on by default will lose those benchmarks and the "ordinary workaday programmers" still end up with trading correctness for speed, since one person at their workplace ran one benchmark once and picked the compiler that won in speed.