News for hackers. Stuff that matters.
Re:All Algorithms Implemented in Rust by 29athrowaway on Sunday August 21, 2022 @10:15PM (#32546574)
It uses unsafe though
Re:All Algorithms Implemented in Rust by eminence32 on Sunday August 21, 2022 @10:33PM (#32546672)
Code that uses the `unsafe` keyword can be safe, though.
Re:All Algorithms Implemented in Rust by 29athrowaway on Sunday August 21, 2022 @10:38PM (#32546700)
Yes, but you are on your own, and future maintainers will also be on their own.
Re:All Algorithms Implemented in Rust by kaba0 on Monday August 22, 2022 @02:29AM (#32548030)
The exact same way all other parts of the code is. You are also on your own in case of any logic bugs, which may well be likely even worse to debug.
Re:All Algorithms Implemented in Rust by 29athrowaway on Monday August 22, 2022 @11:32AM (#32552912)
Yes, but an important reason to migrate a solution to Rust are the guarantees that it offers with respect to safety.

Those guarantees go away if you use "unsafe". In that case, you may just use C or C++.

Re:All Algorithms Implemented in Rust by kaba0 on Monday August 22, 2022 @03:16PM (#32555879)
Small, encapsulated uses of unsafe wrapped in a safe wrapper are entirely different than thousands of lines of unsafe.

Also - many of the borrow checker’s guarantees are enforced inside unsafe as well.