Code Quality Analysis of Translations from C to Rust
Biruk Tadesse, Vikram Nitin, Mazin Salah, Baishakhi Ray, Marcelo d'Amorim, Wesley Assun\c{c}\~ao

TL;DR
This study evaluates the quality of C-to-Rust code translations, revealing that current automated tools and human efforts each have strengths and weaknesses across multiple quality attributes, highlighting the need for comprehensive evaluation methods.
Contribution
It provides a detailed comparison of three C-to-Rust translation techniques using both automated tools and human analysis, uncovering systematic trade-offs and persistent quality issues.
Findings
Automated translations often introduce new issues despite reducing some unsafe patterns.
Human translations still exhibit readability and idiomaticity issues.
No current method consistently outperforms others across all quality metrics.
Abstract
C/C++ is a prevalent programming language. Yet, it suffers from significant memory and thread-safety issues. Recent studies have explored automated translation of C/C++ to safer languages, such as Rust. However, these studies focused mostly on the correctness and safety of the translated code, which are indeed critical, but they left other important quality concerns (e.g., performance, robustness, and maintainability) largely unexplored. This work investigates strengths and weaknesses of three C-to-Rust translators, namely C2Rust (a transpiler), C2SaferRust (an LLM-guided transpiler), and TranslationGym (an LLM-based direct translation). We perform an in-depth quantitative and qualitative analysis of several important quality attributes for the translated Rust code of the popular GNU coreutils, using human-based translation as a baseline. To assess the internal and external quality of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Security and Verification in Computing · Logic, programming, and type systems
