2 ms·
Wasn't this on HN a few weeks ago? Or was that a similar project? It's a fascinating idea. But now you need some way to check the result. Last time around, som
by Animats 6y ago
Wasn't this on HN a few weeks ago? Or was that a similar project?
It's a fascinating idea. But now you need some way to check the result. Last time around, someone noted that some of the translations were plausible but wrong.
There's clearly some guessing. The translation of one function from Python to C++ resulted in untyped bounds becoming ints, which is OK. But it also resulted in a data array becoming ints, although the Python operations were generic over any type with arithmetic operators. The Python code might have been used for floats. It's not doing type inference by looking at the callers; it's just guessing.
Still, it's promising, even if it doesn't do the whole job. There's a C++ to Rust translator, but it turns array indexing into pointer arithmetic on special C++ compatible types. It's compiling into lower level operations. Deep learning has the potential to recognize and use idioms of the target language. Maybe.
But this needs a checker. Perhaps something that runs both language versions in lockstep on test data and checks for disagreement at key points.