# Cpp2Rust: Automatically Translating C++ Code into Safe Rust

Original title: Cpp2Rust: Translates C++ to safe Rust automatically

> Hacker News story 48862086 · language: en · submitted 2026-07-10
> Web version: https://zeli.app/story/48862086
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 18 · by [signa11](<https://news.ycombinator.com/user?id=signa11>) · 💬 0
[original](<https://github.com/Cpp2Rust/cpp2rust>) · [HN discussion](<https://news.ycombinator.com/item?id=48862086>)

## Summary

I am building Cpp2Rust to automatically translate C++ code into safe Rust, helping developers modernize legacy systems without manual rewrites. The tool leverages Clang to parse C++ and generates idiomatic Rust, handling complex features like templates and control flow. Our goal is to make the transition to memory-safe languages seamless and accessible for everyone.

## Key quote

> Translating a label attached to a switch case from C++ to Rust requires refactoring all switch-analysing functions into a single struct to generate labeled blocks correctly.

---

## Cite

- Page: https://zeli.app/story/48862086
- Date: 2026-07-10
- Source: github.com (https://github.com/Cpp2Rust/cpp2rust)
- Hacker News: https://news.ycombinator.com/item?id=48862086

## Other languages

- zh: https://zeli.app/zh/story/48862086 · markdown: https://zeli.app/zh/story/48862086.md
- ja: https://zeli.app/ja/story/48862086 · markdown: https://zeli.app/ja/story/48862086.md
- ko: https://zeli.app/ko/story/48862086 · markdown: https://zeli.app/ko/story/48862086.md
- de: https://zeli.app/de/story/48862086 · markdown: https://zeli.app/de/story/48862086.md
- es: https://zeli.app/es/story/48862086 · markdown: https://zeli.app/es/story/48862086.md
