Live data from Hacker News

There is no memory safety without thread safety

ralfj.de

101–110 of 517 posts

Re: There is no memory safety without thread safety

#101
post #94

Earlier quoted context omitted.

I’d argue that unsafety is binary. If a normal eng doing normal things can break it without going out of their way to deliberately fool the compiler or runtime, I’d call it unsafe.

By that definition Rust also counts as unsafe. Even managed languages like C# and Java would be unsafe.

What kinds of breakage do you have in mind though? The number of times I've segfaulted the JVM is tiny.

Re: There is no memory safety without thread safety

#102
post #95
post #90

Earlier quoted context omitted.

It is kind of wild that for a 21st century programming language, the amount of stuff in Go that should have been but never was, but hey Docker and Kubernetes.

On the flip side, what would be the point? There are already a million other languages that have everything and the kitchen sink. Not going down the same road is the only reason it didn't end up on the pile of obscure languages nobody uses.

The only reason it didn't end on pile of obscure languages nobody uses, it called Google, followed by luck with Docker and Kubernetes adoption on the market, after they decided to rewrite from Python and Java respectively into Go, after Go heads joined their teams.

Case in point, Limbo and Oberon-2, the languages that influenced its design, and authors were involved with.

Re: There is no memory safety without thread safety

#104
post #95
post #90

Earlier quoted context omitted.

It is kind of wild that for a 21st century programming language, the amount of stuff in Go that should have been but never was, but hey Docker and Kubernetes.

On the flip side, what would be the point? There are already a million other languages that have everything and the kitchen sink. Not going down the same road is the only reason it didn't end up on the pile of obscure languages nobody uses.

Well, that and the slight fact that it bears Google's brand name.

I personally appreciate Go as a research experiment. Plenty of very interesting ideas, just as, for instance, Haskell. I don't particularly like it as a development language, but I can understand why some people do.

Re: There is no memory safety without thread safety

#105
post #20

Earlier quoted context omitted.

You mean like the program in the article where code that never dereferences a non-pointer causes the runtime to dereference a non-pointer? That seems like evidence to me.

An exploit against a real Go program that relies on memory corruption.

I think your security background is coloring your perception of the term memory safety. Specifically the requirement that the various issues lead to exploitation. These issues can lead to many other issues that are not vulnerability in the security sense, e.g. data corruption, incorrect (but not insecure) behavior, performance issues, and more. I don't think any of those were ever dismissed or excluded from memory safety discussion. Infosec circles tend to evaluate most ideas in the context of (anti)exploitation, and the rest of programming tends to focus on what the cool kids argue (that is they often weigh security concerns higher than other issues as well), so the other problems caused by double-free or buffer overruns (etc) just may not have been given as much weight in your mind.

Re: There is no memory safety without thread safety

#106
post #94

Earlier quoted context omitted.

I’d argue that unsafety is binary. If a normal eng doing normal things can break it without going out of their way to deliberately fool the compiler or runtime, I’d call it unsafe.

By that definition Rust also counts as unsafe. Even managed languages like C# and Java would be unsafe.

Do you have some examples? I think JDK developers make a lot of effort to make sure users bugs will not corrupt the runtime.

Re: There is no memory safety without thread safety

#108
post #92

Earlier quoted context omitted.

The most common definition of memory safe is literally "cannot segfault" (unless invoking some explicitly unsafe operation - which is not the case here unless you think the "go" keyword should be unsafe).

I don't know the NSA with their white house paper about memory safe language mentioned Go, maybe you should tell that there are wrong.

https://en.wikipedia.org/wiki/Argument_from_authority

Re: There is no memory safety without thread safety

#109
post #94

Earlier quoted context omitted.

I’d argue that unsafety is binary. If a normal eng doing normal things can break it without going out of their way to deliberately fool the compiler or runtime, I’d call it unsafe.

By that definition Rust also counts as unsafe. Even managed languages like C# and Java would be unsafe.

There's a reason why rust devs qualify it as "memory safe" so frequently, we tend to agree that rust is, like virtually every current programming language, unsafe in other ways.

Memory safety is just the source of bugs that we've figured out how to eliminate. It's a significant source of really bad (hard to debug due to action at a distance, high impact, etc) bugs so that's worth a lot, but it's not perfect. And even then we have a more frequently used escape hatch to the memory-unsafe world than would be ideal from a safety perspective for practical reasons.

A more complete version of safety would be achieved with a language that proves code correct to arbitrary specifications. We aren't there yet for there being such a language that is practical for every day use. Personally I'm increasingly optimistic we'll get there sooner rather than later (say, within 20 years). Even then there will probably be specification level bugs that prevent a claim of complete safety...

Re: There is no memory safety without thread safety

#110

Earlier quoted context omitted.

What precisely are you accusing your interlocutor of not understanding?

Why people with vastly more skill and experience programming and writing programming languages made the decisions they did.

The only decisions that matter for languages that get adopted are the decisions that cause adoption.

JS went without static types, Go went without generics, PHP was just a tool for reducing html boilerplate. New languages love to stick null right in there. Rust isn't what Graydon Hoare wanted it to be. Chris Lattner called Swift a failure.

It's all up for criticism.

Post reply on HN