Understanding How Rust Programmers Use Unsafe Code
external page Rust is a new programming language that aims to be a safe replacement for C and C++. Therefore, the Rust type system provides strong guarantees such as a data race freedom. However, sometimes the type system is too restrictive, and as an escape hatch, Rust provides external page unsafe blocks and functions. On the one hand, the type system allows a programmer to do more things in the unsafe code; on the other hand, the programmer has to make sure that their unsafe code does not violate the type system's assumptions. Even though not violating these assumptions is critical for the correctness of many programs, the Rust community is still discussing what should be allowed in unsafe code and what should not. Therefore, there is a need for the community to understand how Rust programmers use unsafe code.
Goals
The main goal of this project is to help the Rust community to understand how Rust programmers use unsafe code. The milestones of this project are:
- To develop a tool that allows extracting the information needed for analysis (for example, abstract syntax trees) from the corpus of the Rust source code published on external page https://crates.io/ and external page https://github.com/.
- To collect statistical information about unsafe code usage. For example:
- What proportion of Rust projects uses unsafe code?
- How often is an unsafe block used to avoid array bounds checks?
- …
- To build a platform that allows the Rust community to perform similar analyses for other aspects of the language.
Useful Prerequisites
The following skills would be advantageous, but can also be learned during the project:
- Familiarity with data analysis techniques and tools.
- Programming experience with Rust.
Opportunities
The project offers the following opportunities:
- Make an important contribution to the Rust community.
- Gain experience with the Rust programming language.
- Gain experience with data analysis techniques.