{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,21]],"date-time":"2026-10-21T16:25:32Z","timestamp":1792599932119,"version":"4.5.0"},"reference-count":55,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T00:00:00Z","timestamp":1780876800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2026,6,8]]},"abstract":"<jats:p>\n                    Previous C-to-Rust translators run the C preprocessor\n                    <jats:monospace>cpp<\/jats:monospace>\n                    on their input before translation. This discards configurability, and it loses programmer-defined abstractions expressed as C macros.\n                  <\/jats:p>\n                  <jats:p>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\u2019s 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.<\/jats:p>\n                  <jats:p>We evaluated Hayroll on CRUST-Bench, LibmCS, and zlib. Hayroll successfully reconstructs most syntactical macros and avoids configuration explosion through symbolic execution. Hayroll\u2019s 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.<\/jats:p>","DOI":"10.1145\/3808276","type":"journal-article","created":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T18:04:09Z","timestamp":1780941849000},"page":"730-753","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":2,"title":["Hayroll: A Modular Wrapper for Translating C Macros and Conditional Compilation to Rust"],"prefix":"10.1145","volume":"10","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-5147-815X","authenticated-orcid":false,"given":"Haoran","family":"Peng","sequence":"first","affiliation":[{"name":"University of Washington, Paul G. Allen School of Computer Science and Engineering, Seattle, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-6122-8998","authenticated-orcid":false,"given":"Baris","family":"Kasikci","sequence":"additional","affiliation":[{"name":"University of Washington, Paul G. Allen School of Computer Science and Engineering, Seattle, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3016-1169","authenticated-orcid":false,"given":"Gilbert Louis","family":"Bernstein","sequence":"additional","affiliation":[{"name":"University of Washington, Paul G. Allen School of Computer Science and Engineering, Seattle, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-9379-277X","authenticated-orcid":false,"given":"Michael D.","family":"Ernst","sequence":"additional","affiliation":[{"name":"University of Washington, Paul G. Allen School of Computer Science and Engineering, Seattle, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2026,6,8]]},"reference":[{"key":"e_1_3_1_2_2","doi-asserted-by":"crossref","unstructured":"Yubo Bai and Tapti Palit. 2025. RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Code. arXiv:2510.07604 [cs.SE] https:\/\/arxiv.org\/abs\/2510.07604","DOI":"10.1109\/ASE63991.2025.00051"},{"key":"e_1_3_1_3_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-032-00828-2_16"},{"key":"e_1_3_1_4_2","doi-asserted-by":"publisher","DOI":"10.1145\/3131704.3131715"},{"key":"e_1_3_1_5_2","doi-asserted-by":"publisher","DOI":"10.1145\/3735452.3735535"},{"key":"e_1_3_1_6_2","unstructured":"Defense Advanced Research Projects Agency (DARPA). 2024. Translating All C TO Rust (TRACTOR). Technical Report. U.S. Department of Defense. https:\/\/sam.gov\/opp\/1e45d648886b4e9ca91890285af77eb7\/view Broad Agency Announcement BAA HR001124S0035."},{"key":"e_1_3_1_7_2","doi-asserted-by":"publisher","DOI":"10.1145\/3586046"},{"key":"e_1_3_1_8_2","doi-asserted-by":"publisher","DOI":"10.1145\/3485498"},{"key":"e_1_3_1_9_2","unstructured":"Hasan Ferit Eniser Hanliang Zhang Cristina David Meng Wang Maria Christakis Brandon Paulsen Joey Dodds and Daniel Kroening. 2025. Towards Translating Real-World Code with LLMs: A Study of Translating to Rust. arXiv:2405.11514 [cs.SE] https:\/\/arxiv.org\/abs\/2405.11514"},{"key":"e_1_3_1_10_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2002.1158288"},{"key":"e_1_3_1_11_2","unstructured":"Muhammad Farrukh Smeet Shah Baris Coskun and Michalis Polychronakis. 2025. SafeTrans: LLM-assisted Transpilation from C to Rust. arXiv:2505.10708 [cs.CR] https:\/\/arxiv.org\/abs\/2505.10708"},{"key":"e_1_3_1_12_2","unstructured":"Aymeric Fromherz and Jonathan Protzenko. 2024. Compiling C to Safe Rust Formalized. arXiv:2412.15042 [cs.PL] https:\/\/arxiv.org\/abs\/2412.15042"},{"key":"e_1_3_1_13_2","unstructured":"Yifei Gao Chengpeng Wang Pengxiang Huang Xuwei Liu Mingwei Zheng and Xiangyu Zhang. 2025. PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust. arXiv:2505.04852 [cs.SE] https:\/\/arxiv.org\/abs\/2505.04852"},{"key":"e_1_3_1_14_2","unstructured":"GTD GmbH. 2025. LibmCS. https:\/\/gitlab.com\/gtd-gmbh\/libmcs."},{"key":"e_1_3_1_15_2","doi-asserted-by":"publisher","unstructured":"Jaemin Hong and Sukyoung Ryu. 2023. Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs. In 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). 716\u2013728. doi:10.1109\/ICSE48619.2023.00069","DOI":"10.1109\/ICSE48619.2023.00069"},{"key":"e_1_3_1_16_2","doi-asserted-by":"publisher","DOI":"10.1145\/3656406"},{"key":"e_1_3_1_17_2","doi-asserted-by":"publisher","DOI":"10.1145\/3691620.3694985"},{"key":"e_1_3_1_18_2","doi-asserted-by":"publisher","unstructured":"Jaemin Hong and Sukyoung Ryu. 2024. Type-migrating C-to-Rust translation using a large language model. Empirical Softw. Engg. 30 1 (Oct. 2024) 38 pages. doi:10.1007\/s10664-024-10573-2","DOI":"10.1007\/s10664-024-10573-2"},{"key":"e_1_3_1_19_2","unstructured":"Jaemin Hong and Sukyoung Ryu. 2025. Forcrat: Automatic I\/O API Translation from C to Rust via Origin and Capability Analysis. arXiv:2506.01427 [cs.SE] https:\/\/arxiv.org\/abs\/2506.01427"},{"key":"e_1_3_1_20_2","unstructured":"Ali Reza Ibrahimzada Brandon Paulsen Reyhaneh Jabbarvand Joey Dodds and Daniel Kroening. 2025. MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair. arXiv:2509.16187 [cs.SE] https:\/\/arxiv.org\/abs\/2509.16187"},{"key":"e_1_3_1_21_2","unstructured":"Immunant Inc. 2018. C2Rust: Automatic Translation from C to Rust. https:\/\/github.com\/immunant\/c2rust. Accessed: 2025-10-28. Original release 2018-04-20.."},{"key":"e_1_3_1_22_2","doi-asserted-by":"publisher","DOI":"10.1145\/1944892.1944908"},{"key":"e_1_3_1_23_2","unstructured":"Anirudh Khatry Robert Zhang Jia Pan Ziteng Wang Qiaochu Chen Greg Durrett and Isil Dillig. 2025. CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilation. arXiv:2504.15254 [cs.SE] https:\/\/arxiv.org\/abs\/2504.15254"},{"key":"e_1_3_1_24_2","unstructured":"The Rust Programming Language. 2025. rust-analyzer. https:\/\/github.com\/rust-lang\/rust-analyzer."},{"key":"e_1_3_1_25_2","unstructured":"Tianyu Li Ruishi Li Bo Wang Brandon Paulsen Umang Mathur and Prateek Saxena. 2025. Adversarial Agent Collaboration for C to Rust Translation. arXiv:2510.03879 [cs.SE] https:\/\/arxiv.org\/abs\/2510.03879"},{"key":"e_1_3_1_26_2","doi-asserted-by":"publisher","DOI":"10.1145\/1960275.1960299"},{"key":"e_1_3_1_27_2","doi-asserted-by":"publisher","DOI":"10.1145\/3510454.3528640"},{"key":"e_1_3_1_28_2","unstructured":"Yuchen Liu Junhao Hu Yingdi Shan Ge Li Yanzhen Zou Yihong Dong and Tao Xie. 2025. LLMigrate: Transforming \u201cLazy\u201d Large Language Models into Efficient Source Code Migrators. arXiv:2503.23791 [cs.PL] https:\/\/arxiv.org\/abs\/2503.23791"},{"key":"e_1_3_1_29_2","unstructured":"Jean loup Gailly and Mark Adler. 2025. zlib. https:\/\/www.zlib.net\/."},{"key":"e_1_3_1_30_2","doi-asserted-by":"crossref","unstructured":"Feng Luo Kexing Ji Cuiyun Gao Shuzheng Gao Jia Feng Kui Liu Xin Xia and Michael R. Lyu. 2025. Integrating Rules and Semantics for LLM-Based C-to-Rust Translation. arXiv:2508.06926 [cs.SE] https:\/\/arxiv.org\/abs\/2508.06926","DOI":"10.1109\/ICSME64153.2025.00069"},{"key":"e_1_3_1_31_2","doi-asserted-by":"publisher","DOI":"10.1145\/2884781.2884793"},{"key":"e_1_3_1_32_2","doi-asserted-by":"publisher","DOI":"10.1145\/2814204.2814206"},{"key":"e_1_3_1_33_2","doi-asserted-by":"crossref","unstructured":"Vikram Nitin Rahul Krishna Luiz Lemos do Valle and Baishakhi Ray. 2025. C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniques. arXiv:2501.14257 [cs.SE] https:\/\/arxiv.org\/abs\/2501.14257","DOI":"10.1109\/TSE.2025.3641486"},{"key":"e_1_3_1_34_2","unstructured":"Office of the National Cyber Director (ONCD). 2024.Back to the Building Blocks: A Path Toward Secure and Measurable Software. Technical Report. The White House Washington DC. https:\/\/bidenwhitehouse.archives.gov\/oncd\/briefing-room\/2024\/02\/26\/press-release-technical-report\/ Press Release: Future Software Should Be Memory Safe."},{"key":"e_1_3_1_35_2","unstructured":"The JuliaMath Organization. 2025. OpenLibm. https:\/\/github.com\/JuliaMath\/openlibm."},{"key":"e_1_3_1_36_2","unstructured":"Guangsheng Ou Mingwei Liu Yuxuan Chen Xueying Du Shengbo Wang Zekai Zhang Xin Peng and Zibin Zheng. 2025. Enhancing LLM-based Code Translation in Repository Context via Triple Knowledge-Augmented. arXiv:2503.18305 [cs.SE] https:\/\/arxiv.org\/abs\/2503.18305"},{"key":"e_1_3_1_37_2","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3623323"},{"key":"e_1_3_1_38_2","doi-asserted-by":"publisher","unstructured":"Haoran Peng Baris Kasikci Gilbert Louis Bernstein and Michael D. Ernst. 2026. Artifact Evaluation Package for Hayroll: A Modular Wrapper for Translating C Macros and Conditional Compilation to Rust. doi:10.5281\/zenodo.19674690","DOI":"10.5281\/zenodo.19674690"},{"key":"e_1_3_1_39_2","unstructured":"Alex Rebert and Christoph Kern. 2024. Secure by design: Google\u2019s perspective on memory safety. Technical report Google Security Engineering (2024)."},{"key":"e_1_3_1_40_2","unstructured":"Microsoft Research. 2025. Z3 Theorem Prover. https:\/\/github.com\/Z3Prover\/z3."},{"key":"e_1_3_1_41_2","doi-asserted-by":"publisher","DOI":"10.1145\/2993236.2993252"},{"key":"e_1_3_1_42_2","unstructured":"Manish Shetty Naman Jain Adwait Godbole Sanjit A. Seshia and Koushik Sen. 2024. Syzygy: Dual Code-Test C to (safe) Rust Translation using LLMs and Dynamic Analysis. arXiv:2412.14234 [cs.SE] https:\/\/arxiv.org\/abs\/2412.14234"},{"key":"e_1_3_1_43_2","unstructured":"Momoko Shiraishi and Takahiro Shinagawa. 2024. Context-aware Code Segmentation for C-to-Rust Translation using Large Language Models. arXiv:2409.10506 [cs.SE] https:\/\/arxiv.org\/abs\/2409.10506"},{"key":"e_1_3_1_44_2","unstructured":"HoHyun Sim Hyeonjoong Cho Yeonghyeon Go Zhoulai Fu Ali Shokri and Binoy Ravindran. 2025. Large Language Model-Powered Agent for C to Rust Code Translation. arXiv:2505.15858 [cs.PL] https:\/\/arxiv.org\/abs\/2505.15858"},{"key":"e_1_3_1_45_2","first-page":"421","volume-title":"Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference (Philadelphia, PA) (USENIX ATC'14)","author":"Tartler Reinhard","year":"2014","unstructured":"Reinhard Tartler, Christian Dietrich, Julio Sincero, Wolfgang Schr\u00f6der-Preikschat, and Daniel Lohmann. 2014. Static analysis of variability in system software: the 90,000 #ifdefs issue. In Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference (Philadelphia, PA) (USENIX ATC'14). USENIX Association, USA, 421\u2013432."},{"key":"e_1_3_1_46_2","unstructured":"The tree-sitter Project. 2025. tree-sitter. https:\/\/github.com\/tree-sitter\/tree-sitter."},{"key":"e_1_3_1_47_2","unstructured":"The tree-sitter Project. 2025. tree-sitter-c. https:\/\/github.com\/tree-sitter\/tree-sitter-c."},{"key":"e_1_3_1_48_2","doi-asserted-by":"crossref","unstructured":"Chaofan Wang Tingrui Yu Chen Xie Jie Wang Dong Chen Wenrui Zhang Yuling Shi Xiaodong Gu and Beijun Shen. 2025. EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation. arXiv:2508.04295 [cs.SE] https:\/\/arxiv.org\/abs\/2508.04295","DOI":"10.1145\/3786583.3786856"},{"key":"e_1_3_1_49_2","doi-asserted-by":"publisher","unstructured":"Xiafa Wu and Brian Demsky. 2025. GenC2Rust: Towards Generating Generic Rust Code from C. In 2025 IEEE\/ACM 47th International Conference on Software Engineering (ICSE). 90\u2013102. doi:10.1109\/ICSE55347.2025.00127","DOI":"10.1109\/ICSE55347.2025.00127"},{"key":"e_1_3_1_50_2","doi-asserted-by":"publisher","DOI":"10.1145\/3735544.3735582"},{"key":"e_1_3_1_51_2","unstructured":"Aidan Z. H. Yang Yoshiki Takashima Brandon Paulsen Josiah Dodds and Daniel Kroening. 2024. VERT: Verified Equivalent Rust Transpilation with Large Language Models as Few-Shot Learners. arXiv:2404.18852 [cs.PL] https:\/\/arxiv.org\/abs\/2404.18852"},{"key":"e_1_3_1_52_2","unstructured":"Zhiqiang Yuan Wenjun Mao Zhuo Chen Xiyue Shang Chong Wang Yiling Lou and Xin Peng. 2025. Project-Level C-toRust Translation via Synergistic Integration of Knowledge Graphs and Large Language Models. arXiv:2510.10956 [cs.SE] https:\/\/arxiv.org\/abs\/2510.10956"},{"key":"e_1_3_1_53_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-37709-9_22"},{"key":"e_1_3_1_54_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10515-025-00570-0"},{"key":"e_1_3_1_55_2","doi-asserted-by":"publisher","unstructured":"Han Zhou Yu Luo Mengtao Zhang and Dianxiang Xu. 2025. C2RustTV: An LLM-based Framework for C to Rust Translation and Validation. In 2025 IEEE 49th Annual Computers Software and Applications Conference (COMPSAC). 1254\u20131259. doi:10.1109\/COMPSAC65507.2025.00158","DOI":"10.1109\/COMPSAC65507.2025.00158"},{"key":"e_1_3_1_56_2","unstructured":"Tianyang Zhou Haowen Lin Somesh Jha Mihai Christodorescu Kirill Levchenko and Varun Chandrasekaran. 2025. LLM-Driven Multi-step Translation from C to Rust using Static Analysis. arXiv:2503.12511 [cs.SE] https:\/\/arxiv.org\/abs\/2503.12511"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3808276","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,22]],"date-time":"2026-09-22T10:47:48Z","timestamp":1790074068000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3808276"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,8]]},"references-count":55,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2026,6,8]]}},"alternative-id":["10.1145\/3808276"],"URL":"https:\/\/doi.org\/10.1145\/3808276","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,8]]},"assertion":[{"value":"2025-11-14","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-04-03","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-06-08","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}