Sequence-to-sequence models have achieved good performance in natural language translation. Could these models also be applied to convert source code written in one programming language to source code written in another language? Could they also be used to convert JSON to XML? Has this been done?

There are plenty of models that generate source code (which looks like real source code) using RNNs, although the generated source code doesn't make logical sense. I haven't been able to find any models or examples that take valid existing code and convert it into different valid code.

  • 1
    $\begingroup$ I don't think common techniques would work very well for this. The reason being (currently) most models perform poorly at perfect results. By that I mean, they are prone to very small mistakes. Like in translating french to english, if done well, you might find a word containing one extra vowel, a small mistake any human would have no problem with. However, as you know, this would not pass in a programming language. $\endgroup$
    – Recessive
    Dec 17 '19 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.