News for hackers. Stuff that matters.
Re:Rust Sucks If I Fail to Write X by tyoverby on Friday February 17, 2017 @01:40PM (#13670590)
In the rust world "unsafe" is synonymous with "isn't proven to be safe by the compiler". Under this definition, every C/C++ program that uses pointers is "unsafe" because the languages make no memory safety guarantees.
Re:Rust Sucks If I Fail to Write X by jstimpfle on Friday February 17, 2017 @03:35PM (#13671483)
No. He clearly stated that usage of an "unsafe" implementation is safer in Rust than C/C++. See my other post.
Re:Rust Sucks If I Fail to Write X by pklausler on Friday February 17, 2017 @02:28PM (#13670958)
Raw pointers, maybe. But not std::unique_ptr<>, if I understand Rust's concept here.
Re:Rust Sucks If I Fail to Write X by dbaupp on Friday February 17, 2017 @02:35PM (#13671017)
unique_ptr is unfortunately still unsafe (in the Rust sense): there's nothing in the language stopping use-after-move of the unique_ptr value itself (which is a null-dereference and undefined behaviour), nor references to the interior becoming dangling.
Re:Rust Sucks If I Fail to Write X by kibwen on Friday February 17, 2017 @02:36PM (#13671024)
Owned data in Rust (which is all data by default, unlike C++ which must opt-in via unique_ptr) has stronger guarantees than those provided by unique_ptr. It's still possible to deref a unique_ptr after using std::move.
Re:Rust Sucks If I Fail to Write X by sidlls on Friday February 17, 2017 @01:49PM (#13670659)
That may be technically true but in practice and rhetoric "unsafe" is often used in contexts with much broader, implicit connotations. For example, putting Rust-compiler-proven-safety as the top, first, or best feature to consider. In that context, saying "C++ isn't Rust-safe" is essentially defining Rust to be "better", not advancing a coherent argument that it is in fact better.