Translating C to Safer Rust
summary
Paper presents an automated C→Rust translation that infers lifetimes and ownership, rewrites function and struct signatures, and iteratively uses Rust compiler errors to promote pointers through a lattice up to ownership or raw pointers. Evaluation on 17 open-source C programs fixes 76% of lifetime-unsafe pointers and 89% of their references, but overall only 8% of all pointers because many are unsafe for multiple reasons. Tool finishes most benchmarks in under two minutes; libxml2 requires 125 minutes. Process guarantees termination and can fall back to the original program.
AI-written summary · about
chapters (12)
- 0:00Intro
- 0:13Outline
- 1:04Rust: an alternative
- 2:04The big picture
- 4:27Quantitative results
- 5:48Focus: Unsafe pointers
- 9:29Deriving lifetime information
- 10:08Figuring out lifetimes: Struct fields
- 10:47Figuring out lifetimes: Function signatures
- 11:48Configurations
- 12:56Qualitative results
- 14:07Performance results
related talks
18mAliasing Limits on Translating C to Safe Rust
28mC2Rust: Migrating Legacy Code to Rust
19mCpp2Rust: Automatic Translation of C++ to Safe Rust
36mRust as a High-Level Langage
01h 01mMemory Safety: Rust vs. C
01h 04mRust-ifying Your C# Codebase: A Tale of Adventure and Transformation
06mHow We Replace Common C and C++ Libraries
31mUsing Rust from C... or Any Language
