Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's always a trade off. I don't think that humans are capable of perfectly pulling off manual memory management or multi-threading, as a biological limitation of our wetware. But I may just be stupid.

Either way, the problems that rust takes off the plate don't seem arbitrary for that reason. I don't particularly mind the problems it adds to the plate.

Calling a trade-off a slippery slope to a zero-set language is really disingenuous.



But that's not Rust's actual tradeoff. Safe Rust prevents data races not because they were separately considered as a tradeoff, but because its particular chosen design for memory safety requires it. It's a side-effect, not an orthogonal feature.

And I wasn't saying there's an actual slippery slope, only that the argument that if something is tricky it should be moved out of the safe subset is not a good one. The justification Rust uses to do this for memory safety is because memory safety was empirically found to be special, but that particular justification doesn't work for concurrency (nor is it the one used; again, in Rust this is a side-effect).


> Safe Rust prevents data races not because they were separately considered as a tradeoff, but because its particular chosen design for memory safety requires it. It's a side-effect, not an orthogonal feature.

Data race freedom has been specified as a requirement for UB-freedom (i.e. safe code) since the C11/C++11 concurrency model, which predates the Rust borrow checker. You can make different choices on particular platforms, but they come with challenging tradeoffs: e.g. in Java, variables of type "long" are not data-race free on 32-bit platforms; writes to a long can silently tear.


They can, but without UB (in Java, or in Zig with .unordered); the C++11 memory model is a choice. Also, the desire to not have any UB is not justified as strongly as the desire to have spatial and temporal memory safety, and since restrictions also exclude correct programs, which leads to more unsafe, it's definitely not a pure win.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: