News for hackers. Stuff that matters.
Re:Why Not Rust? (2020) by nine_k on Sunday December 19, 2021 @12:30AM (#29611626)
Does using Rc or Arc feel morally wrong?

Having shared mutable state, or doing bare pointer arithmetics is "morally wrong" in the sense that it's a constant source of bugs in production, sometimes dangerous. Any language that reminds you about that is doing a useful thing; C++ is very much capable of that, too.

Re:Why Not Rust? (2020) by zozbot234 on Sunday December 19, 2021 @12:45AM (#29611691)
Meh, bare pointer arithmetic (and shared mutability, for that matter) can be quite morally OK if it's properly isolated to a self-contained module, with detailed specifications on its behavior. That's why Rust has an `unsafe` facility. It's morally wrong to use it across modules (because it's obviously non-compositional), but that's not what Rust devs are doing. This is not C/C++.
Re:Why Not Rust? (2020) by kaba0 on Monday December 20, 2021 @05:58AM (#29623407)
And good OOP is exactly about encapsulating that mutable part.
Re:Why Not Rust? (2020) by verdagon on Sunday December 19, 2021 @01:25AM (#29611901)
It's a bit silly to say shared mutable state is morally wrong. Rust programs have shared mutable state in that indices often refer to mutable data, and Java programs allow more conventional shared mutability without memory unsafety.

Shared mutability can enable some bugs, like the existence of a CPU enables bugs, but that doesn't mean CPUs are morally wrong.

Re:Why Not Rust? (2020) by Guvante on Sunday December 19, 2021 @03:39AM (#29612400)
Raw shared mutability is a mine field the moment mutations that depend on the current state occur.

If incrementing doesn't always increment you are in for a bad time after all.

You are always going to have data that is shared and changes. Any non trivial system will. Rust just discourages the naive "just point to the heap" method that tends to work until it doesn't.

Re:Why Not Rust? (2020) by pjmlp on Sunday December 19, 2021 @04:19AM (#29612529)
Except Rust can only help when the heap being pointed to isn't shared across processes, possiblity written in multiple languages, e.g. NUMA shared memory.
Re:Why Not Rust? (2020) by Guvante on Tuesday December 21, 2021 @11:33PM (#29645629)
If you do a crazy enough thing it will break isn't material to my statement "naively accessing the heap as if that is thread safe is bad anyway".