Re:Transpiling between any programming languages (2019)
by empath75 on Sunday February 16, 2020 @01:27PM
(#22342977)
Iām wondering if you had a large enough corpus you could use the same techniques you use for NLP translation.
[ Parent
| on HN ]
Re:Transpiling between any programming languages (2019)
by anoncake on Monday February 17, 2020 @07:04AM
(#22347094)
If you heavily modify them, that might work quite well. Every machine translation models contains language models for the source and target language that specify what a valid sentence in each language looks like. In NLP translation, they are approximations created by ML. Our models for programming languages are much better: We have the exact syntax, type systems should also help.
However, AFAIK modern MT systems are pretty much blackboxes and the language models cannot be separated from the rest of the model. In any case, it wouldn't be as easy as plugging a compiler into the system to check if the output compiles.