Automatically Translating C to Rust

Legacy system programs developed in C have suffered from prevalent memory bugs. Migrating these systems to Rust is a promising way to enhance reliability, thanks to Rust’s strong safety guarantee. Due to the high cost of manual migration, automatic C-to-Rust translators are essential for enabling the migration of real-world systems. However, existing translators generate unsatisfactory code by relying on language features whose safety is not validated by the compiler and code patterns considered unidiomatic by Rust developers. To improve the quality of automatic translation, static analysis and code transformation can be employed to replace unsafe features and unidiomatic patterns with safe and idiomatic alternatives. This article discusses the research community’s efforts to address scalar pointers, locks, unions with tags, and output parameters, and introduces remaining unsafe features and unidiomatic patterns that future work should tackle. Furthermore, we explore the potential of using large language models for C-to-Rust translation.

Authors

Institutions

Publication Details

Journal
Communications of the ACM
Published
2025-10-24
DOI
https://doi.org/10.1145/3737696
Primary Topic
Model-Driven Software Engineering Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Automatically Translating C to Rust

Jaemin Hong, Sukyoung Ryu
Communications of the ACM
Model-Driven Software Engineering Techniques
article

Automatically Translating C to Rust

Jaemin Hong, Sukyoung Ryu
article en

Abstract

Legacy system programs developed in C have suffered from prevalent memory bugs. Migrating these systems to Rust is a promising way to enhance reliability, thanks to Rust’s strong safety guarantee. Due to the high cost of manual migration, automatic C-to-Rust translators are essential for enabling the migration of real-world systems. However, existing translators generate unsatisfactory code by relying on language features whose safety is not validated by the compiler and code patterns considered unidiomatic by Rust developers. To improve the quality of automatic translation, static analysis and code transformation can be employed to replace unsafe features and unidiomatic patterns with safe and idiomatic alternatives. This article discusses the research community’s efforts to address scalar pointers, locks, unions with tags, and output parameters, and introduces remaining unsafe features and unidiomatic patterns that future work should tackle. Furthermore, we explore the potential of using large language models for C-to-Rust translation.

Communications of the ACMVol. 68(11)
Daejeon University (KR), Korea Advanced Institute of Science and Technology (KR)
Openalex Percentile: Top 68%
Model-Driven Software Engineering Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.