(no title)
chadaustin | 7 months ago
Swift has (had?) the same issue and I had to write a program to illustrate that Swift is (was?) perfectly happy to segfault under shared access to data structures.
Go has never been memory-safe (in the Rust and Java sense) and it's wild to me that it got branded as such.
tptacek|7 months ago
This is just two groups of people talking past each other.
It's not as if Go programmers are unaware of the distinction you're talking about. It's literally the premise of the language; it's the basis for "share by communicating, don't communicate by sharing". Obviously, that didn't work out, and modern Go does a lot of sharing and needs a lot of synchronization. But: everybody understands that.
moefh|7 months ago
> the issue here is that the "Rust and Java sense" of memory safety is not the actual meaning of the term
So what is the actual meaning? Is it simply "there are no cases of actual exploited bugs in the wild"?
Because in another comment you wrote:
> a term of art was created to describe something complicated; in this case, "memory safety", to describe the property of programming languages that don't admit to memory corruption vulnerabilities, such as stack and heap overflows, use-after-frees, and type confusions. Later, people uninvolved with the popularization of the term took the term and tried to define it from first principles, arriving at a place different than the term of art.
But type confusion is exactly what has been demonstrated in the post's example. So what kind of memory safety does Go actually provide, in the term of art sense?
Ygg2|7 months ago
It's been in usage for PLT for at least twenty years[1]. You are at least two decades late to the party.
[1]https://llvm.org/pubs/2003-05-05-LCTES03-CodeSafety.pdfsocalgal2|7 months ago
Everybody does not understand that otherwise there would be zero of these issues in shipping code.
This is the problem with the C++ crowd hoping to save their language. Maybe they'll finally figure out some --disallow-all-ub-and-be-memory-safe-and-thread-safe flag but at the moment it's still insanely trivial to make a mistake and return a reference to some value on the stack or any number of other issues.
The answer can not be "just write flawless code and you'll never have these issues" but at the moment that's all C++, and Go, from this article has.
dev_l1x_be|7 months ago
I had to convince Go people that you can segfault with Go. Or you mean the language designers with using everybody?
blub|7 months ago
Hence the focus on fearless concurrency or other small-scale idioms like match in an attempt to present Rust as an overall better language compared to other safe languages like Go, which is proving to be a solid competitor and is much easier to learn and understand.
junebash|7 months ago
RetpolineDrama|7 months ago
~130k LoC Swift app was converted from 5 -> 6 for us in about 3 days.
ardit33|7 months ago
Swift is strating to look more like old java beans. (if you are old enough to remember this, most swift developers are too young). Doing some of the same mistakes.
Anways https://forums.swift.org/t/has-swifts-concurrency-model-gone... Common problems all devs face: https://www.massicotte.org/problematic-patterns
Anyways, they are trying to reinvent 'safe concurrency' while almost throwing the baby with the bathwater, and making swift even more complex and harder to get into.
There is ways to go. For simple apps, the new concurrency is easy to adopt. But for anything that is less than trivial, it becomes a lot of work, to the point that it might not make it worth it.
cosmic_cheese|7 months ago
potato-peeler|7 months ago
tsimionescu|7 months ago
maxlybbert|7 months ago
nine_k|7 months ago
Rust avoids all this entirely, by using its type system.
CJefferson|7 months ago
Rust on the other hand solves that. There is code you can't write easily in Rust, but just yesterday I took a rust iteration, changed 'iter()' to 'par_iter()', and given it compiled I had high confidence it was going to work (which it did).
rowanG077|7 months ago
Thaxll|7 months ago
Not synchronizing writes on most data structure does not create a SEGFAULT, you have to be in a very specific condition to create one, those conditions are extremely rares and un-usual ( from the programmer perspective).
In OP blog to triggers one he's doing one of those condition in an infinite loop.
https://research.swtch.com/gorace
commandersaki|7 months ago
commandersaki|7 months ago
Or put another way what is the likelihood that a go program is memory unsafe?
tapirl|7 months ago
unknown|7 months ago
[deleted]
pjmlp|7 months ago
9rx|7 months ago
Not going down the same road is the only reason it didn't end up on the pile of obscure languages nobody uses.
nosefrog|7 months ago
gok|7 months ago
ferreiratb|7 months ago
adamwk|7 months ago
mirashii|7 months ago
sapiogram|7 months ago
LtWorf|7 months ago
Mawr|7 months ago
kstrauser|7 months ago
sapiogram|7 months ago
shadowgovt|7 months ago
int_19h|7 months ago
pjmlp|7 months ago