News for hackers. Stuff that matters.
Re:Writing secure Go code by kaba0 on Monday November 04, 2024 @05:50PM (#42046875)
It's only on Go, leave Rust out of it. Rust's safe part is entirely memory safe. Unsafe is the escape hatch, which pretty much every language has in the form of FFI.
Re:Writing secure Go code by tptacek on Monday November 04, 2024 @08:13PM (#42047747)
That's not true: idiomatic Rust projects use `unsafe` much more liberally than other languages use FFI, because of shared xor mutable. That's not a knock on Rust. I couldn't be less interested in Rust vs. Go; I use both and would use them both in different situations.
Re:Writing secure Go code by vacuity on Monday November 04, 2024 @11:15PM (#42048557)
I doubt that "idiomatic Rust projects use unsafe liberally". It is a more liberal construct, perhaps, but IMO actual usage is usually reasonable. Unless you mean the standard libary's use of unsafe?
Re:Writing secure Go code by tptacek on Monday November 04, 2024 @11:42PM (#42048664)
I'm not saying it isn't reasonable, just that it serves a different role in Rust than unsafe/JNI would in Java: there are things you naturally want to express in Rust, not having anything directly to do with interfacing with external code, that want `unsafe` in order to (carefully) bypass shared xor mutable.