3 ms·
Instead of defining what happens in the situation, most languages opt for making this type of error impossible in the first place. Languages with a GC do this b
by ben-schaaf 8y ago
Instead of defining what happens in the situation, most languages opt for making this type of error impossible in the first place. Languages with a GC do this by never freeing if a reference still exists. Rust (safe) does this by enforcing lifetimes at compile time.
- millstone 8y agoThese languages aren't capable of expressing the software that's routinely written in C (inc C++). For example, there's no way to enforce the lifetimes of NaN-boxed pointers managed by the multithreaded GC in the custom heap of your browser's JS engine. There's certain classes of C's UB that can be addressed, but most of it can never be without neutering C to the point of uselessness.