3 ms·
Is there an example of what you're describing?
by nine_k 2y ago
Is there an example of what you're describing?
- steveklabnik 2y agoThere’s a recent drama where the Rust folks asked some people to clarify some of the semantics of some of the filesystem APIs, and this request wasn’t taken well. There’s been a bunch of hn threads about it.
- asne11 2y agolike which?
- steveklabnik 2y agoI apologize, I am on my phone, so rather than curating links, check out https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=rust%20linux&sort=byDate&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu..., most of which are about this situation.
- xgstation 2y agonot sure if this is what the op referred but like this one https://news.ycombinator.com/item?id=41450347 https://news.ycombinator.com/item?id=41450347 didn't find threads that regarding "clarify APIs semantics", but kernel docs are indeed not in a very good condition. Since C does not provide same level of soundness that Rust does, there are many hidden traps. asahi developer had a good discuss about this https://threadreaderapp.com/thread/1829852697107055047.html https://threadreaderapp.com/thread/1829852697107055047.html
- steveklabnik 2y agoThis overall situation is, yes. And the stuff from Lina is related, thanks for also pointing that out.
- pornel 2y agoAbout invariants generally: Rust wants to know when memory behind each pointer is immutable, or mutable by Rust only, or could be mutated by something else while Rust has a pointer to it. Rust also encodes which types can't be moved to another thread, and which pointers own their memory and need to be freed by Rust. These are part of the type system, so they need to be defined precisely. The answer to these questions can't be just "it depends". If there are run-time or config-dependent conditions when the same data is owned or not or immutable or not, Rust has enums, unions and unsafe escape hatches to guard access to it.