Scylla: Translating an Applicative Subset of C to Safe Rust
Aymeric Fromherz, Jonathan Protzenko

TL;DR
This paper presents a method for incrementally converting C code to safe Rust by restructuring C code to meet Rust's safety requirements, using type-directed translation and static analysis, demonstrated on real-world libraries.
Contribution
It introduces a type-directed translation from a C subset to safe Rust, a novel static analysis with split trees, and a compilation strategy for C pointer types compatible with Rust.
Findings
Successfully applied to cryptographic libraries and parsers
Generated Rust code with performance similar to C
Identified undefined behaviors in real-world libraries
Abstract
The popularity of the Rust language continues to explode; yet, many critical codebases remain authored in C. Automatically translating C to Rust is thus an appealing course of action. Several works have gone down this path, handling an ever-increasing subset of C through a variety of Rust features, such as unsafe. While the prospect of automation is appealing, producing code that relies on unsafe negates the memory safety guarantees offered by Rust, and therefore the main advantages of porting existing codebases to memory-safe languages. We instead advocate for a different approach, where the programmer iterates on the original C, gradually making the code more structured until it becomes eligible for compilation to safe Rust. This means that redesigns and rewrites can be evaluated incrementally for performance and correctness against existing test suites and production environments.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTransport and Economic Policies · Forest Biomass Utilization and Management
