←back to thread

155 points samuell | 1 comments | | HN request time: 0.207s | source
Show context
JonChesterfield ◴[] No.44751587[source]
One could presumably compile arbitrary C++ to rust or D without changing semantics, then slowly go through the result making it look more native to the new language.

That would either be a wholesale conversion or emitting a translation shim style thing at the boundary between legacy c++ and the new language.

I'm not sure Carbon is necessary to achieve such a conversion.

replies(3): >>44751803 #>>44751964 #>>44752137 #
1. nicwilson ◴[] No.44752137[source]
This was essentially how DMD (the reference D compiler) was translated to D. However this was mostly a restricted subset of C++ common to both of them, e.g. no diamond inheritance, no operator overloading whackiness.