Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is true, but anyone can catch a logic bug, whereas seeing undefined behavior can take someone familiar with it.


Linters will easily catch undefined behavior, better than humans in my experience.


This is in fact a large part of why people are so pro Rust. Think of the compiler as a very strict linter, one so strict it can catch things that just aren’t semantically possible in many other languages, including C++.


> Linters will easily catch undefined behavior, better than humans in my experience.

Now imagine if the linter is not optional.

Oh, yeah, that is Rust!


Some linters catch some undefined behavior, but not all undefined behavior (I'm guessing not even most undefined behavior). And no one runs linters. If they did, a ton of CVEs would just vanish. But they haven't.


That’s exactly what the Rust compiler is: a fully sound^* linter for lifetimes

* up to implementation bugs in the compiler


no they don't. every use of + in C++ is potentially undefined behavior.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: