▲ | simonask 2 days ago | |
The point about "gibberish" is getting at a fundamental misunderstanding that people have about Undefined Behavior. Rust's concept of "safety" really means "absence of Undefined Behavior". Lots of people don't seem to understand that C, C++, and Zig programs containing UB are gibberish - they are not C, C++, or Zig programs, but something else entirely. The key insight here is that in any language, UB invalidates the entire program. It no longer does what you think it does, your tests are all moot, and so on. But a lot of people seem to think that there is an acceptable amount of UB in any code base. There isn't. UB is a concept that exists for every language, even languages like Python, Java, C#, JavaScript, but those languages make it very hard to encounter accidentally. Before Rust, there was no way to guarantee the absence of UB without a significant runtime cost, so that's a very meaningful invention. |