Hayroll: A Modular Wrapper for Translating C Macros and Conditional Compilation to Rust
This program is tentative and subject to change.
Previous C-to-Rust translators run the C preprocessor cpp on their input before translation. This discards configurability, and it loses programmer-defined abstractions expressed as C macros.
We present Hayroll, a modular wrapper that makes C-to-Rust translation preprocessor-aware without modifying the underlying translator. Hayroll consists of two cooperating layers. The conditional compilation translation layer uses symbolic execution to derive activation conditions for each line of the source code. It splits the program into a set of configuration-specific translation tasks that together cover every line of code. These tasks are then passed independently to the macro translation layer. The macro translation layer classifies macros, annotates macro-expanded nodes with tags, and sends the code through the underlying translator. It then reconstructs C macros as Rust functions or macros by retrieving these tags from the translator’s output. Because the layers communicate only through task partitioning and source-code annotations, the underlying translator remains a black box; no invasive changes are required. Our implementation uses C2Rust, but the design is translator-agnostic.
We evaluated Hayroll on CRUST-Bench, LibmCS, and zlib. Hayroll successfully reconstructs most syntactical macros and avoids configuration explosion through symbolic execution. Hayroll's output passes the same tests as the underlying C-to-Rust transpiler. These results show that decoupled preprocessor analysis can restore configurability and abstraction to C-to-Rust translation in a practical and modular way.
This program is tentative and subject to change.
Fri 19 JunDisplayed time zone: Mountain Time (US & Canada) change
14:00 - 15:40 | |||
14:00 20mTalk | Cpp2Rust: Automatic Translation of C++ to Safe Rust PLDI Research Papers Lucian Popescu INESC-ID; Instituto Superior Técnico - University of Lisbon, Francisco Gouveia INESC-ID; Instituto Superior Técnico - University of Lisbon, Henrique Preto INESC-ID; Instituto Superior Técnico - University of Lisbon, João Silveira INESC-ID; Instituto Superior Técnico - University of Lisbon, Dmytro Hrybenko Google, José Fragoso Santos INESC-ID; Instituto Superior Técnico - University of Lisbon, Nuno P. Lopes INESC-ID; Instituto Superior Técnico - University of Lisbon DOI Pre-print | ||
14:20 20mTalk | &inator: Correct, Precise C-to-Rust Interface Translation PLDI Research Papers Victor Chen Ohio State University, Ayden Coughlin Ohio State University, Michael D. Bond Ohio State University DOI Pre-print | ||
14:40 20mTalk | Hayroll: A Modular Wrapper for Translating C Macros and Conditional Compilation to Rust PLDI Research Papers Haoran Peng University of Washington, Baris Kasikci University of Washington, Gilbert Louis Bernstein University of Washington, Michael D. Ernst University of Washington DOI Pre-print | ||
15:00 20mTalk | VerusBelt: A Semantic Foundation for Verus’s Proof-Oriented Extensions to the Rust Type SystemDistinguished Paper PLDI Research Papers Travis Hance MPI-SWS, Laila Elbeheiry MPI-SWS, Yusuke Matsushita Kyoto University, Derek Dreyer MPI-SWS DOI | ||
15:20 20mTalk | Pure Borrow: Linear Haskell Meets Rust-Style Borrowing PLDI Research Papers DOI Pre-print | ||