{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,5]],"date-time":"2026-07-05T04:25:14Z","timestamp":1783225514081,"version":"3.54.6"},"reference-count":47,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2024,6,20]],"date-time":"2024-06-20T00:00:00Z","timestamp":1718841600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100003725","name":"National Research Foundation of Korea","doi-asserted-by":"publisher","award":["2022R1A2C200366011,2021R1A5A1021944"],"award-info":[{"award-number":["2022R1A2C200366011,2021R1A5A1021944"]}],"id":[{"id":"10.13039\/501100003725","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/501100010418","name":"Institute for Information and communications Technology Promotion","doi-asserted-by":"publisher","award":["2022-0-00460,2023-2020-0-01819"],"award-info":[{"award-number":["2022-0-00460,2023-2020-0-01819"]}],"id":[{"id":"10.13039\/501100010418","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100004358","name":"Samsung Electronics Co., Ltd","doi-asserted-by":"crossref","award":["G01210570"],"award-info":[{"award-number":["G01210570"]}],"id":[{"id":"10.13039\/100004358","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2024,6,20]]},"abstract":"<jats:p>\n            Translating legacy system programs from C to Rust is a promising way to enhance their reliability. To alleviate the burden of manual translation, automatic C-to-Rust translation is desirable. However, existing translators fail to generate Rust code fully utilizing Rust\u2019s language features, including algebraic data types. In this work, we focus on tuples and\n            <jats:monospace>Option\/Result<\/jats:monospace>\n            types, an important subset of algebraic data types. They are used as functions\u2019 return types to represent those returning multiple values and those that may fail. Due to the absence of these types, C programs use\n            <jats:italic toggle=\"yes\">output parameters<\/jats:italic>\n            , i.e., pointer-type parameters for producing outputs, to implement such functions. As output parameters make code less readable and more error-prone, their use is discouraged in Rust. To address this problem, this paper presents a technique for removing output parameters during C-to-Rust translation. This involves three steps: (1) syntactically translating C code to Rust using an existing translator; (2) analyzing the Rust code to extract information related to output parameters; and (3) transforming the Rust code using the analysis result. The second step poses several challenges, including the identification and classification of output parameters. To overcome these challenges, we propose a static analysis based on abstract interpretation, complemented by the notion of\n            <jats:italic toggle=\"yes\">abstract read\/write sets<\/jats:italic>\n            , which approximate the sets of read\/written pointers, and two sensitivities:\n            <jats:italic toggle=\"yes\">write set sensitivity<\/jats:italic>\n            and\n            <jats:italic toggle=\"yes\">nullity sensitivity<\/jats:italic>\n            . Our evaluation shows that the proposed technique is (1) scalable, with the analysis and transformation of 190k LOC within 213 seconds, (2) useful, with the detection of 1,670 output parameters across 55 real-world C programs, and (3) mostly correct, with 25 out of 26 programs passing their test suites after the transformation.\n          <\/jats:p>","DOI":"10.1145\/3656406","type":"journal-article","created":{"date-parts":[[2024,6,20]],"date-time":"2024-06-20T16:27:20Z","timestamp":1718900840000},"page":"716-740","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":18,"title":["Don\u2019t Write, but Return: Replacing Output Parameters with Algebraic Data Types in C-to-Rust Translation"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-4067-7369","authenticated-orcid":false,"given":"Jaemin","family":"Hong","sequence":"first","affiliation":[{"name":"KAIST, Daejeon, South Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0019-9772","authenticated-orcid":false,"given":"Sukyoung","family":"Ryu","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, South Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2024,6,20]]},"reference":[{"key":"e_1_3_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/2889160.2889229"},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3477132.3483570"},{"key":"e_1_3_1_4_1","first-page":"19","volume-title":"Proceedings of the 14th USENIX Conference on Operating Systems Design and Implementation (OSDI\u201920)","author":"Boos Kevin","year":"2020","unstructured":"Kevin Boos, Namitha Liyanage, Ramla Ijaz, and Lin Zhong. 2020. Theseus: An Experiment in Operating System Structure and State Management. In Proceedings of the 14th USENIX Conference on Operating Systems Design and Implementation (OSDI\u201920). USENIX Association, USA, Article 1, 19 pages."},{"key":"e_1_3_1_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/512950.512973"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3542948"},{"key":"e_1_3_1_7_1","unstructured":"Al Danial. 2023. cloc. https:\/\/github.com\/AlDanial\/cloc."},{"key":"e_1_3_1_8_1","unstructured":"Sergio De Simone. 2022. Linux 6.1 Officially Adds Support for Rust in the Kernel. https:\/\/www.infoq.com\/news\/2022\/12\/linux-6-1-rust."},{"key":"e_1_3_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3586046"},{"key":"e_1_3_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3485498"},{"key":"e_1_3_1_11_1","unstructured":"GNU. 2023. GNU Package Blurbs. https:\/\/www.gnu.org\/manual\/blurbs.html."},{"key":"e_1_3_1_12_1","doi-asserted-by":"crossref","unstructured":"Maria Handjieva and Stanislav Tzolovski. 1998. Refining Static Analyses by Trace-Based Partitioning Using Control Flow. In Static Analysis Giorgio Levi (Ed.). Springer Berlin Heidelberg Berlin Heidelberg 200\u2013214.","DOI":"10.1007\/3-540-49727-7_12"},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/1480881.1480911"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00069"},{"key":"e_1_3_1_15_1","doi-asserted-by":"publisher","unstructured":"Jaemin Hong and Sukyoung Ryu. 2024. Don\u2019t Write but Return: Replacing Output Parameters with Algebraic Data Types in C-to-Rust Translation (Artifact). https:\/\/doi.org\/10.5281\/zenodo.10795858 10.5281\/zenodo.10795858","DOI":"10.5281\/zenodo.10795858"},{"key":"e_1_3_1_16_1","unstructured":"Tim Hutt. 2021. Would Rust secure cURL? https:\/\/blog.timhutt.co.uk\/curl-vulnerabilities-rust\/."},{"key":"e_1_3_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3158154"},{"key":"e_1_3_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3230624"},{"key":"e_1_3_1_19_1","first-page":"552","volume-title":"The Rust Programming Language","author":"Klabnik Steve","year":"2018","unstructured":"Steve Klabnik and Carol Nichols. 2018. The Rust Programming Language (1 ed.). No Starch Press. 552 pages.","edition":"1"},{"key":"e_1_3_1_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/3365137.3365395"},{"key":"e_1_3_1_21_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-59851-8_22"},{"key":"e_1_3_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/3132747.3132786"},{"key":"e_1_3_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3460120.3484541"},{"key":"e_1_3_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/2926697.2926707"},{"key":"e_1_3_1_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510454.3528640"},{"key":"e_1_3_1_26_1","first-page":"464","volume-title":"Clean Code: A Handbook of Agile Software Craftsmanship","author":"Martin Robert C.","year":"2008","unstructured":"Robert C. Martin. 2008. Clean Code: A Handbook of Agile Software Craftsmanship (1st ed.). Pearson. 464 pages.","edition":"1"},{"key":"e_1_3_1_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/2663171.2663188"},{"key":"e_1_3_1_28_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-31987-0_2"},{"key":"e_1_3_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/2187671.2187672"},{"key":"e_1_3_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806596.1806631"},{"key":"e_1_3_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/566172.566174"},{"key":"e_1_3_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/1044834.1044835"},{"key":"e_1_3_1_33_1","first-page":"19","volume-title":"Proceedings of the 14th USENIX Conference on Operating Systems Design and Implementation (OSDI\u201920)","author":"Narayanan Vikram","year":"2020","unstructured":"Vikram Narayanan, Tianjiao Huang, David Detweiler, Dan Appel, Zhaofeng Li, Gerd Zellweger, and Anton Burtsev. 2020. RedLeaf: Isolation and Communication in a Safe Operating System. In Proceedings of the 14th USENIX Conference on Operating Systems Design and Implementation (OSDI\u201920). USENIX Association, USA, Article 2, 19 pages."},{"key":"e_1_3_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/2254064.2254092"},{"key":"e_1_3_1_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/1275497.1275501"},{"key":"e_1_3_1_36_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4842-5949-8"},{"key":"e_1_3_1_37_1","unstructured":"Rust. 2023a. Guide to Rustc Development. https:\/\/rustc-dev-guide.rust-lang.org\/."},{"key":"e_1_3_1_38_1","unstructured":"Rust. 2023b. Guide to Rustc Development: The HIR. https:\/\/rustc-dev-guide.rust-lang.org\/hir.html."},{"key":"e_1_3_1_39_1","unstructured":"Rust. 2023c. Guide to Rustc Development: The MIR. https:\/\/rustc-dev-guide.rust-lang.org\/mir\/index.html."},{"key":"e_1_3_1_40_1","unstructured":"Rust. 2023d. Module std::option. https:\/\/doc.rust-lang.org\/std\/option\/index.html."},{"key":"e_1_3_1_41_1","unstructured":"Rust. 2023e. Module std::result. https:\/\/doc.rust-lang.org\/std\/result\/index.html."},{"key":"e_1_3_1_42_1","unstructured":"Rust. 2023f. Primitive Type tuple. https:\/\/doc.rust-lang.org\/std\/primitive.tuple.html."},{"key":"e_1_3_1_43_1","unstructured":"Rust. 2023g. Rust by Example: if let. https:\/\/doc.rust-lang.org\/rust-by-example\/flow_control\/if_let.html."},{"key":"e_1_3_1_44_1","volume-title":"Two Approaches to Interprocedural Data Flow Analysis","author":"Sharir Micha","year":"1981","unstructured":"Micha Sharir and Amir Pnueli. 1981. Two Approaches to Interprocedural Data Flow Analysis. Prentice-Hall, Inc., Englewood Cliffs, New Jersey, Chapter 7."},{"key":"e_1_3_1_45_1","doi-asserted-by":"publisher","DOI":"10.1145\/53990.54007"},{"key":"e_1_3_1_46_1","doi-asserted-by":"publisher","DOI":"10.1145\/1926385.1926390"},{"key":"e_1_3_1_47_1","unstructured":"Frances Wingerter. 2022. C2Rust is Back. https:\/\/immunant.com\/blog\/2022\/06\/back\/."},{"key":"e_1_3_1_48_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-37709-9_22"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3656406","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3656406","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,7,4]],"date-time":"2025-07-04T20:40:35Z","timestamp":1751661635000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3656406"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,6,20]]},"references-count":47,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2024,6,20]]}},"alternative-id":["10.1145\/3656406"],"URL":"https:\/\/doi.org\/10.1145\/3656406","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,6,20]]},"assertion":[{"value":"2024-06-20","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}