Skip to content

From C to Idiomatic Rust: A Ship-of-Theseus Agentic Translation

Jul 2026 · arXiv.org · Vol abs/2607.28835 · 0 citations · 16 references
Computer Science

TL;DR

This paper presents a migration methodology that first generates a semantics-preserving, non-idiomatic Rust baseline and then incrementally rewrites it into idiomatic Rust using agentic AI, validating each step through compilation and behavioural testing.

Abstract

C underpins operating systems, embedded platforms, and network infrastructure as its abstractions map directly to machine behaviour. Its explicit memory model, predictable data representations, and minimal runtime allow compilers to generate fast, deterministic code. These properties also leave correctness and memory safety entirely to the programmer, making undefined behaviour, pointer misuse, and lifetime errors persistent sources of defects and security vulnerabilities in long-lived C codebases. Rust eliminates most failure modes through a static ownership and borrowing model that enforces memory safety and aliasing constraints at compile time. However, mature C systems cannot be translated directly: implicit layout assumptions, aliasing patterns, and undefined behaviour must be reconstructed before safe Rust can be produced. This paper presents a migration methodology that first generates a semantics-preserving, non-idiomatic Rust baseline and then incrementally rewrites it into idiomatic Rust using agentic AI, validating each step through compilation and behavioural testing. Applied to iodine, a real-world DNS tunnel, the approach demonstrates that reliable C-to-Rust migration is a structured transformation workflow rather than a single translation step.

View source

Similar papers

Open access 2026

Agentic C to Rust Translation

An alternative agentic approach that gives an LLM freedom and guardrails, and a publicly available implementation named ACTOR that outperforms all previous tools to automatically translate C to Rust.

Benedikt Schesch, Michael D. Ernst · 0 citations

Agentic translation of C to Rust

An alternate agentic approach that gives an LLM freedom and guardrails is presented that gives an LLM freedom and guardrails in the Rust programming language, a promising replacement for C.

Benedikt Schesch, Michael D. Ernst · 0 citations
Open access Oct 2026

Bringing Foundational Verification to Real-World Rust Code

How to extend RefinedRust with several of the high-level abstractions that Rust provides, including traits, closures, and iterators, and in a manner such that they can be used in conjunction with unsafe code.

Lennard Gäher, Vincent Lafeychine, Sascha Kehrli et al. · 0 citations
#software testing Open access Sep 2026

LLM-Assisted Porting of Security-Critical C Libraries to Idiomatic Rust: A Multi-Model Empirical Study

Differential fuzzing reveals complementary bugs in the manual and LLM porting of security-critical C libraries to idiomatic Rust and translates these findings into concrete practical guidance for teams planning a similar migration.

Marco Parrillo, Marco Grassi, Luigi Laura · 0 citations
Jul 2026

A Type-and-Effect System for Temporal Dependency Analysis of Render-based Reactive Programs

Willow, a core calculus for reactive programming inspired by React, gives a time-aware operational semantics that models computation in terms of renders, the fundamental evaluation step in which components produce user interface descriptions, and pairs it with a novel type-and-effect system that statically tracks timin...

June Wunder, Ankush Das, Marco Gaboardi · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.