RustMap: Towards Project-Scale C-to-Rust Migration via Program Analysis and LLM
Not on the map. Why?
Abstract (arXiv)
Migrating existing C programs into Rust is increasingly desired, as Rust offers superior memory safety while maintaining C's high performance. However, vastly different features between C and Rust--e.g., distinct definitions and usages of pointers and references--pose significant challenges beyond mere syntactic translation. Existing automated translation tools, such as C2Rust, may rely too much on syntactic, template-based translation and generate unsafe Rust code that is hard for human developers to read, maintain, or even compile. More semantic-aware translation that produces safer, idiomatic, and runnable Rust code is much needed. This paper introduces a novel dependency-guided and large language model (LLM)-based C-to-Rust translation approach, RustMap, based on three key ideas: (1) Utilize LLM capabilities to produce idiomatic Rust code from given small pieces of C code, (2) Mitigate LLM limitations in handling large codebases by breaking project-scale C programs into smaller units for translation according to their usage dependencies and composing them into a runnable Rust program, and (3) Enhance the correctness of the translated Rust program by using test cases to check input/output equivalence, isolate faulty code when execution states deviate, and iteratively refine the translation using feedback from compilation and test errors. We empirically evaluate RustMap on 126 real-world programs, including 125 from Rosetta Code and a 7000+ line bzip2 implementation using GPT-4o as the LLM. RustMap shows promising results, guiding GPT-4o to produce idiomatic, readable, and functional Rust code with significantly less unsafe code than other tools, and revealing non-trivial translation patterns reusable for future research.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). First posted on arXiv 22 Mar 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 5; 2026: 5.
10 papers.
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 18
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repaircited by 3
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translationcited by 3
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphscited by 3
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translationcited by 2
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositoriescited by 2
- 2025Multi-Agent Systems for Dataset Adaptation in Software Engineering: Capabilities, Limitations, and Future Directionscited by 1
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migrationcited by 1
- 2026Documentation-Guided Agentic Codebase Migration from C to Rustcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translationcited by 0
- 2026Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translation14 Sep 2026
- 2026Documentation-Guided Agentic Codebase Migration from C to Rust14 May 2026
- 2026ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories8 Apr 2026
- 2026ENCRUST: Encapsulated Substitution and Agentic Refinement on a Live Scaffold for Safe C-to-Rust Translation6 Apr 2026
- 2026His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration3 Mar 2026
- 2025Multi-Agent Systems for Dataset Adaptation in Software Engineering: Capabilities, Limitations, and Future Directions26 Nov 2025
- 2025Project-Level C-to-Rust Translation via Pointer Knowledge Graphs13 Oct 2025
- 2025Adversarial Agent Collaboration for Correctness Improvements of C to Safe Rust Translation4 Oct 2025
- 2025MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair19 Sep 2025
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation6 Aug 2025