5 ms·
https://www.youtube.com/watch?v=iOBXVOAbpdY https://www.youtube.com/watch?v=iOBXVOAbpdY Rust is not as safe as it claimed, not to mention many will use its un
by ausjke 6y ago
https://www.youtube.com/watch?v=iOBXVOAbpdY https://www.youtube.com/watch?v=iOBXVOAbpdY Rust is not as safe as it claimed, not to mention many will use its unsafe mode in practice anyways.
- throwaway17_17 6y agoI’m not sure what the downvotes are for. The paper, upon which the video is based is linked in the description and is easily accessed. Is the issue primarily with parent’s less than substantial comment (basically just linking to a conference talk) or is there some issue with the underlying empirical analysis of Rust’s library codebase? The thrust of the article is, from the abstract, that Rust should consider altering the compiler and the crates ecosystem to better enable the safety features that Rust champions, because ‘ results indicate that software engineers use the keyword \unsafe in less than 30% of Rust libraries, but more than 75% cannot be entirely statically checked by the Rust compiler’.
- steveklabnik 6y ago> Is the issue primarily with parent’s less than substantial comment I would assume this, but also > is there some issue with the underlying empirical analysis of Rust’s library codebase? this is hard to tell, because > The paper, upon which the video is based is linked in the description and is easily accessed I don't think this is true, or else, I am missing it somehow. Where is the paper? I don't see it linked from the page that's linked in the description, and a quick google of the title didn't turn it up for me either.
- throwaway17_17 6y agoIt is available on arXiv. Link follows: https://arxiv.org/abs/2007.00752 https://arxiv.org/abs/2007.00752
- steveklabnik 6y agoIt's... fine. It's got some issues though. Like: > Since Unsafe Rust may modify an arbitrary memory location, any use of Unsafe Rust in any dependency compromises the static guarantees of the whole library With this definition, literally every Rust program is not safe, because: 1. Most operating systems don't have syscalls written in Rust, so doing anything at all ends up needing unsafe. 2. Even if you wrote an OS with safe syscalls, doing things with the hardware is going to require unsafe. So, buried somewhere in there, unsafe will exist. So I don't personally think this definition makes a lot of sense. To me personally, comments like this are more interesting, and tell a different story: > The number of unsafe blocks per crate is small for the majority of the crates, more than 90% of the crates have fewer than ten unsafe blocks This validates one of Rust's core propositions, IMHO. From eyeballing the graph, it seems that ~70 of crates have zero unsafe? Very interesting.