Lifting the Preprocessor with Oxidize: Structure-Preserving C-to-Rust Translation (Technical Report)

πŸ“… 2026-09-24
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This study addresses the challenge that conventional macro preprocessing expansion during C-to-Rust transpilation leads to the loss of original code abstraction structures and semantic corruption. To overcome this, we propose Oxidize, a system introducing a novel structure-preserving translation mechanism that directly maps C macros to Rust macros to maintain high-level abstractions. Technically, the approach designs a custom intermediate representation (IR) alongside a macro type system, leveraging auxiliary traits and generic conversion macros to achieve precise transpilation. Experimental evaluations across nine real-world C codebases demonstrate that this method delivers high-fidelity transpilation with minimal performance overhead, effectively resolving the longstanding macro handling difficulties inherent in cross-language migration.
πŸ“ Abstract
This technical report accompanies our EuroSys 2027 paper "Lifting the Preprocessor with Oxidize: Structure-Preserving C-to-Rust Translation" (DOI 10.1145/3842654.3848533). Oxidize is a C-to-Rust translator that retains C macros as Rust macros instead of expanding them away, so that the translated code keeps the abstractions its developers wrote. The report collects material the paper cites but has no room for: the translator's intermediate representation, pass structure and back-end emission; the details of macro typing through helper traits and the generic cast macro; the sources and pinned revisions of the nine evaluated C codebases; the per-codebase macro population and how macros are attributed to classes; a roadmap from structure-preserving translation toward safe Rust; the performance overhead study and its methodology; and the configuration and prompt used for the LLM-based baselines.
Problem

Research questions and friction points this paper is trying to address.

C-to-Rust translation
macro preservation
structure-preserving translation
code abstraction
Innovation

Methods, ideas, or system contributions that make the work stand out.

C-to-Rust translation
structure-preserving
macro lifting
intermediate representation
safe Rust
R
Robbe De Greef
Vrije Universiteit Brussel
T
ThΓ©o Engels
Royal Military Academy
F
Felix Van den Broucke
Vrije Universiteit Brussel
K
Ken Hasselmann
Royal Military Academy
Antonio Paolillo
Antonio Paolillo
Senior Researcher, IDSIA USI-SUPSI, Lugano
RoboticsAIMachine Learning