top | item 45589351

(no title)

john_the_writer | 4 months ago

Agreed. I rather dislike the idea of "safe" coding languages. Fighting with a memory leak in an elixir app, for the past week. I never viewed c or c++ as unsafe. Writing code is hard, always has been, always will be. It is never safe.

discuss

order

simonask|4 months ago

This is a bit of a misunderstanding.

Safe code is just code that cannot have Undefined Behavior. C and C++ have the concept of "soundness" just like Rust, just no way to statically guard against it.

rileymat2|4 months ago

There is more than undefined behavior, if I was to define using an uninitialized variable as yielding whatever data was previously in that location, it is well defined but unsafe.

gcr|4 months ago

Modern compilers like clang and GCC both have static analysis for some of this. Check out the undefined behavior sanitizer.

jen20|4 months ago

A memory leak is not a memory safety issue.

rileymat2|4 months ago

No, but it can be dangerous when you run out of memory for critical systems.