4 ms·
Can C++ be machine-translated to Carbon? That would be useful. Translating C++ to Rust is too hard - the underlying data models are too different. What would b
by Animats 4y ago
Can C++ be machine-translated to Carbon? That would be useful.
Translating C++ to Rust is too hard - the underlying data models are too different. What would be really useful would be something that intelligently translates pointer-based C++ code into a slice-based language. Every place there's an unsized array, something has to figure out how big it is and pass that info around. In the original program, that information had to be present in some form. The trick is finding it.
That's probably not out of reach for a static analyzer today. Especially if machine learning is used to help find the usual idioms of C/C++. First find, then check.