3 ms·
From the abstract: > Our results indicate that software engineers use the keyword unsafe in less than 30% of Rust libraries, but more than half cannot be entir
by qzw 5y ago
From the abstract:
> Our results indicate that software engineers use the keyword unsafe in less than 30% of Rust libraries, but more than half cannot be entirely statically checked by the Rust compiler because of Unsafe Rust hidden somewhere in a library's call chain. We conclude that although the use of the keyword unsafe is limited, the propagation of unsafeness offers a challenge to the claim of Rust as a memory-safe language.
I don’t think it’s accurate to say that any use of unsafe necessarily propagates to all code in the call chain. Often safe abstractions are built around the unsafe blocks to effectively limit the scope of unsafeness. It’s not clear from the abstract whether this analysis accounts for such scenarios.
- tialaramex 5y agoMaybe it would be a fun blog project. Take popular crates.io crates which have safety wrappers (unsafe code, wrapped in a safe function, we aren't interested in crates that just expose an unsafe function, or are purely safe) and: Each week pick a safety wrapper at random, and take it to pieces. Is the safety rationale convincing? Missing altogether? Bogus for some reason? This seems like it's potentially an interesting exercise, it's educational, and if you find any bugs this way you improve the ecosystem for everybody. Mmm. Am I missing a reason this would be a terrible idea?
- kibwen 5y ago> Am I missing a reason this would be a terrible idea? Nope, people in the Rust community love seeing these sorts of things. Here's one from just last week where someone went through and fuzzed all the popular HTTP client libraries, which went on to become the third-most upvoted post on /r/rust of all time: https://www.reddit.com/r/rust/comments/oir1g1/ive_tested_rust_http_clients_again_found_over_50/ https://www.reddit.com/r/rust/comments/oir1g1/ive_tested_rus...