logoalt Hacker News

logicchopyesterday at 9:33 PM2 repliesview on HN

If I can autoport my C++ to Rust, and the port is confirmed identical, and the Rust is confirmed safe, can't I use that to reason about the safety of my C++? Is safe C++ just a matter of proving it has a safe Rust equivalent?


Replies

johnbenderyesterday at 9:42 PM

It depends on what “confirmed identical” means. Most compilers (or translators as you like) only guarantee that the output program represents a subset of the behaviors of the input program so it could be that subset is the “safe as in Rust” subset.

_fluxyesterday at 9:49 PM

The conversions seem to use (sometimes?) unsafe blocks.