The readme is rather slim on C++ versions.
keep in mind that rust:
- does not prevent logic errors
- does not prevent stack overflows
- does not prevent out of memory errors
- does not prevent bitflips caused by faulty hardware or cosmic rays
- does not prevent memory leaks
- does not prevent unrecoverable errors (panics)
- does not prevent memory safety related issues in an unsafe context
Granted the premise is rather brittle, since all Cpp2Rust does is to convert UB to runtime crashes, which can be undecidable, and cannot be used to prove anything about the original C++ code.
If your C++ code is more "legacy" than "modern", the migration is generally still straightforward, but will often involve additional run-time overhead, like it does with this cpp2rust, but to a lesser degree I think. Objects allocated on the stack can (safely) remain allocated on the stack even when they are the target of pointers. And still, no `RefCell<>` equivalents are required for objects that aren't shared between threads.
[1] https://github.com/duneroadrunner/scpptool/blob/master/READM...
In this particular example I see no real safety benefits. If the source program is buggy, the result translated program willcrash at runtime, but if it's (mostly) bug-free and UB-free, such translation gives no benefits.
> our reference-counted translation model, where every variable is pessimistically wrapped inside a Rc<RefCell<T>> type, checks that would usually execute at compile-time are shifted to run time, degrading performance.
I'm not yet convinced that the issue of C's unsafety is better solved by translating it to Rust rather than using Fil-C [2].