Undefined behavior exists in a spec for efficiency reasons. For example, accessing an out of bound index in C remains undefined as Having the runtime check boundaries on every index access is an inefficiency reserved for less efficient language specs like python.
Rust aims to solve these problems with something called zero cost abstractions.
Rust aims to solve these problems with something called zero cost abstractions.