News for hackers. Stuff that matters.
Re:Major standard library changes in Go 1.20 by lnxg33k1 on Monday January 16, 2023 @11:28PM (#34409132)
Yeah I think a language is safe or unsafe according to the ecosystem they live in. A project a developer works on is hardly 100% self-developed and depends on library and third party code, so I understand you have experiments you need to enable, but once it starts spreading in libraries, I think the whole safety guarantee just goes out of the window?

As a rust student myself, even the unsafe{} block is stupid

Re:Major standard library changes in Go 1.20 by kaba0 on Tuesday January 17, 2023 @03:00AM (#34410161)
Rust’s unsafe is still much safer than your average C code. The borrow checker checks inside unsafe blocks as well, you can just circumvent it through pointers.

But the great thing with unsafe blocks is that you get to create a safe API abstraction on top. You manually verify closely the unsafe parts, and if you got that short part right you can use the safe wrapper wherever you want safely.