(no title)
cv5005 | 1 year ago
All of these 'problems' have simple and straigtforward workarounds, I'm not convinced these UB are needed at all.
cv5005 | 1 year ago
All of these 'problems' have simple and straigtforward workarounds, I'm not convinced these UB are needed at all.
nemothekid|1 year ago
He gave you a simple and straightforward example, but that example may not be representative of a real world program where complex analysis leads to better performing code.
As a programmer, its far easier to just insert bounds checks everywhere, and trust the system to remove them when possible. This is what Rust does, and it safe. The problem isn't the compiler, the problem is the standard. More broadly, the standard wasn't written with optimizing compilers in mind.
ncruces|1 year ago
It's not like I'm saying C is the best possible way to write new code.
I'm just commenting why this matters for performance, and “remove all undefined behavior" from C compilers is a non-starter.
Now go write Rust for all I care.