His2Trans: A Knowledge-Guided Agentic Framework for Project-Level C-to-Rust Migration

Abstract

C remains a major implementation language for operating systems, embedded platforms, and infrastructure software, but manual memory management continues to create security and maintenance costs. Rust is a practical migration target because it retains low-level control while enforcing stronger memory-safety checks. At project scale, especially under gradual C/Rust coexistence, migration is not a sequence of syntax-preserving function rewrites. A translator must preserve project interfaces, observable behavior, system interaction protocols, and low-level interoperability boundaries while staying consistent with migration choices already made in the codebase. We introduce His2Trans, a knowledge-guided agentic framework for project-level C-to-Rust migration. His2Trans reuses interface-level and fragment-level knowledge mined from historical C/Rust migrations to guide new translations toward Rust interfaces, wrapper choices, and local idioms already accepted in the evolving project. It then refines the assembled crate with project-level agentic feedback. On ten OpenHarmony modules, His2Trans reaches a 100.00\% incremental compilation pass rate, a 94.92\% Test Pass Rate, and a 16.35\% Unsafe Ratio. On eight open-source C projects, it reaches 100.00\% for both incremental compilation and Test Pass Rate, reducing Unsafe Ratio from 42.88\% under C2Rust to 8.59\%. These results support knowledge-guided migration and project-level agentic refinement as practical mechanisms for preserving observable behavior while reducing the unsafe burden of rule-based transpilation.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…