News for hackers. Stuff that matters.
Re:Writing secure Go code by Thaxll on Monday November 04, 2024 @05:28PM (#42046650)
Go is memory safe by modern standard.

If I show you a UB in Rust without the use of unsafe does it means Rust is unsafe?

Re:Writing secure Go code by K0nserv on Monday November 04, 2024 @05:38PM (#42046751)
I believe UB without unsafe is considered a bug by the Rust language team.

I should’ve said in my original comment, but I don’t mean to dunk on Go. In practice the issues illustrated in the blog post I linked seem unlikely to cause problems in practice, they are interesting nevertheless.

Re:Writing secure Go code by Yoric on Monday November 04, 2024 @05:33PM (#42046704)
What does that mean?

If I follow correctly, assuming that there are no bugs in the compilers/interpreters, Go is less memory-safe than Java, C#, Python (with GIL), JavaScript or Rust. The only languages that are less memory safe would be C, C++ or Zig.

Re:Writing secure Go code by kaba0 on Monday November 04, 2024 @05:47PM (#42046854)
That would mean it, yes. And yeah there is a bug in rust's borrow checker which can trigger something like that for some very special, "no human will ever write code like that" case. But this is an implementation detail for a semantically memory safe language, while in go's case having UB is a language primitive here.
Re:Writing secure Go code by Thaxll on Monday November 04, 2024 @05:56PM (#42046933)
The trigger for Go is exactly "no human will ever write code like that".