Towards Macro-Aware C-to-Rust Transpilation (WIP)
summary
Claims a macro-aware C-to-Rust transpiler called Oxidize that preserves macro abstractions instead of expanding everything, built from scratch and using a macro contracting pipeline plus generated helper traits and type-parameterized Rust macros to handle C promotions. Evaluation on Figlet finds over 70% expression-like macros and retains 46 out of 58 macro sites (≈85%); demo transpiles and links Doom’s main file and runs with warnings, while nontranspilable reshaping macros are expanded.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 0:23Macro-aware transpiler context
- 1:06C pre-processor role and challenges
- 2:11Macro contracting and transpilable macros
- 3:15Expression-like macros as targets
- 3:36Textual C macros and scoping problems
- 4:17Macro uniqueness and shadowing issues
- 5:22Implicit type promotions in C
- 6:25Type mismatch solutions in macros
- 7:08Figlet transpiling and results
- 8:32Future work and paper recs
- 8:52Live demo: Doom transpilation
- 10:39Q&A
related talks
20mHayroll: A Modular Wrapper for Translating C Macros and Conditional Compilation to Rust
39mRust metaprogramming - macro_rules! beyond basics
45mDeveloping Macros in Rust
25m"Eternal Sunshine of the Rustfmt'ed Mind"
24mProcedural Macros 101
27mRust GCC Front-end
01h 03mModern Macros
40mLet's Build a Hygienic Macro Expander
