←back to thread

155 points samuell | 1 comments | | HN request time: 0.974s | 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 #
zem ◴[] No.44751803[source]
I would be stunned if you could compile arbitrary c++ to rust or d, unless by "compile" you mean "painfully hand-translate and spend months fixing subtle errors". you are underestimating the sheer complexity of the language.
replies(2): >>44752875 #>>44753933 #
1. troad ◴[] No.44752875[source]
Agreed, but it would be much worse than you suggest. Many meaty C++ projects have an underlying architecture that could not even be expressed in (safe) Rust. The idea of transpiling a major C++ project and getting it running in Rust with only some minimal idiom fiddling seems utterly fantastical.