Translating Large-Scale C Repositories to Idiomatic Rust
Saman Dehghan (1), Tianran Sun (2), Tianxiang Wu (1), Zihan Li (1), Reyhaneh Jabbarvand (1) ((1) University of Illinois at Urbana-Champaign, USA, (2) Shanghai Jiao Tong University, China)

TL;DR
Rustine is an automated pipeline that effectively translates large C repositories into safe, idiomatic, and readable Rust code, achieving high functional equivalence and safety improvements over prior methods.
Contribution
The paper introduces Rustine, a fully automated, scalable C-to-Rust translation pipeline that produces safe, idiomatic code with high functional accuracy, surpassing existing techniques.
Findings
Rustine achieves 87% functional equivalence on diverse C programs.
Rustine produces safer and more idiomatic Rust code compared to prior methods.
Human developers need only 4.5 hours on average to complete translations when tests fail.
Abstract
Existing C to Rust translation techniques fail to balance quality and scalability: transpilation-based approaches scale to large projects but produce code with poor safety, idiomaticity, and readability. In contrast, LLM-based techniques are prohibitively expensive due to their reliance on frontier models (without which they cannot reliably generate compilable translations), thus limiting scalability. This paper proposes Rustine, a fully automated pipeline for effective and efficient repository-level C to idiomatic safe Rust translation. Evaluating on a diverse set of 23 C programs, ranging from 27 to 13,200 lines of code, Rustine can generate fully compilable Rust code for all and achieve 87% functional equivalence (passing 1,063,099 assertions out of 1,221,192 in test suites with average function and line coverage of 74.7% and 72.2%). Compared to six prior repository-level C to Rust…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Logic, programming, and type systems · Software Engineering Research
