News for hackers. Stuff that matters.
Re:Uber Go Style Guide by weberc2 on Saturday October 12, 2019 @08:10AM (#21232412)
Ok, then educate me—what is ownership if not the responsibility for managing (cleaning up) a resource? In my C and C++ days, I never heard of it refer to some kind of exclusive permission to mutate a resource (which seems to be your meaning), but rather as the responsibility to free the resource (as in “the owner must and only the owner _can_ free the owner resource”).

It seems likely that you and I are using different definitions, and yours Rust-specific (and therefore not meaningfully generalizable to other languages, especially those with GC).

Re:Uber Go Style Guide by twic on Saturday October 12, 2019 @02:54PM (#21235357)
Ownership is (at least) two things: who has the responsibility for destroying an object when it's finished with, which GC takes care of, and who has the right to mutate an object while it's alive, which GC doesn't.

I mostly write Java for a living, have done for a decade, and still occasionally trip myself up by mutating an object I'd forgotten I've shared.

Re:Uber Go Style Guide by steveklabnik on Saturday October 12, 2019 @10:58AM (#21233640)
In Rust, we also say that it’s the right to destroy.
Re:Uber Go Style Guide by weberc2 on Saturday October 12, 2019 @01:14PM (#21234637)
Thanks for responding, Steve. I understand that “ownership” implies the right to destroy in any language. The bit I’m not so clear about is whether or not there are other rights/responsibilities (such as the right to mutate) as the OP suggests and whether a definition that includes those rights/responsibilities can meaningfully apply to any language or just Rust.
Re:Uber Go Style Guide by steveklabnik on Saturday October 12, 2019 @10:22PM (#21237865)
I think they’re talking about the borrow checker, which is technically distinct from ownership.