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

>No, you can do that, and can do so safely (if you implemented the unsafe parts correctly, at least).

That is equally true of C++; you're completely safe as long as you don't make any mistakes.



The entire C++ language is an unsafe block. I think you're trying to be funny, but you missed the point.

A concrete example of safety is that Rust can tell you if you reference memory from an arena after the arena goes out of scope. C++ can not.


You're not wrong. Rust's contribution is that it statically verifies safety as much as possible, and when not possible, at least isolates all code which could potentially be unsafe. The means that if the program segfaults or has a data race or other unsafe behaviour, the programmer need only focus on code marked as unsafe to fix it.

In practice, most applications have hardly any unsafe code, delegating all of their unsafe behaviour to libraries that have presumably been thoroughly tested.


If by true you mean false then yes I agree.

There is a world of difference between this block/function is unsafe rest is enforced by compiler and everything written is unsafe, lets download third party program to check.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: