Ownership guided C to Rust translation

Zhang, Hanliang; David, Cristina; Yu, Yijun and Wang, Meng (2023). Ownership guided C to Rust translation. In: Computer Aided Verification. CAV 2023. Lecture Notes in Computer Science (Enea, Constantin and Lal, Akash eds.), Lecture Notes in Computer Science, Springer, Cham.

DOI: https://doi.org/10.1007/978-3-031-37709-9_22

Abstract

Dubbed a safer C, Rust is a modern programming language that combines memory safety and low-level control. This interesting combination has made Rust very popular among developers and there is a growing trend of migrating legacy codebases (very often in C) to Rust. In this paper, we present a C to Rust translation approach centred around static ownership analysis. We design a suite of analyses that infer ownership models of C pointers and automatically translate the pointers into safe Rust equivalents. The resulting tool, Crown, scales to real-world codebases (half a million lines of code in less than 10 seconds) and achieves a high conversion rate.

Viewing alternatives

Download history

Metrics

Public Attention

Altmetrics from Altmetric

Number of Citations

Citations from Dimensions

Item Actions

Export

About