logoalt Hacker News

shikck200 • yesterday at 3:30 PM • 4 replies • view on HN

That does not make sense to me. Go is memory-safe, but it does not guarantee data-race freedom.

So whats your point here? Haskell?


Replies

SupLockDef • yesterday at 3:40 PM

Probably Rust, that's always Rust with this kind of comments...

➕ show 2 replies
beltsazar • yesterday at 4:20 PM

> That does not make sense to me.

You said that because you assumed Go is memory-safe in all conditions.

> Go is memory-safe

Yes, but only if there's no data race.

Go is not like Java. Java doesn't guarantee no data race, but when it happens, it's still memory-safe.

➕ show 1 reply
simonask • yesterday at 4:04 PM

There is no memory safety without freedom from data races. One is a prerequisite of the other. This is why languages like C# throw exceptions on unsynchronized concurrent access to some container types, and treat all property accesses as atomic.

➕ show 2 replies
amelius • yesterday at 4:12 PM

I suppose that if you create a map in one thread, and then access it from another thread, then that might cause segmentation faults? Because map is a type that is implemented in C.

➕ show 1 reply