Challenges in C++ to Rust Translation with Large Language Models: A Preliminary Empirical Study

Yanyan Yan, Yang Feng, Qi He, Jun Zeng, Baowen Xu · 2025

C++ programming language is one of the mainstream choices for developing various systems due to its efficiency and widespread application, particularly in fields with high-performance requirements. However, C++ programs may have many memory management and security issues, such as dangling pointers and memory leaks, which pose increasing challenges in modern software development. As a modern programming language designed to address memory safety issues, Rust has gained widespread attention for its ownership system and memory safety features, driving research and practice in migrating C++ code to Rust. However, the differences in syntax and features between C++ and Rust, as well as C++'s complex and object-oriented features, make it extremely difficult to directly convert C++ code into Rust code.

Read the paper · More papers on PaperTik