K0nserv 9 days ago

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.

Yoric 9 days ago

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.

kaba0 9 days ago

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.

  • Thaxll 9 days ago

    The trigger for Go is exactly "no human will ever write code like that".