4 ms·
And yet somehow languages such as Rust, which have no UB (in the safe subset) manages to be within 5% of C and often faster in both real-world codebases and mic
by dralley 2y ago
And yet somehow languages such as Rust, which have no UB (in the safe subset) manages to be within 5% of C and often faster in both real-world codebases and microbenchmarks.
- fooker 2y agoIt’s just a change in jargon for ‘marketing’ reasons. For example: Rust will silently wrap signed integers in release mode even when it’s considered a bug and crashes in debug mode.
- Slyfox33 2y agoSigned overflow is not UB in rust. That's not the same thing at all.
- fooker 2y agoIt’s not. You have missed my point.
- sixfiveotwo 2y ago[dead]
- rcxdude 2y agoThat is pretty much the only example where there's a compromise between performance and correctness as a difference between release and debug mode, and note that it's a) not undefined behaviour and b) does not violate any of rust's safety guarantees. Every other example you mention is done by rust in release mode and the performance impact is minimal, so I would say it's a good counterexample to your claims that defining these things would hamstring performance (signed integer overflow especially is an obvious no-brainer for defining. Note that doesn't necessarily mean overflow checks! Even just defining the result precisely would remove a lot of footguns).