Unsupervised Translation of Programming Languages
Marie-Anne Lachaux Thanks: Equal contribution. The order was determined randomly. Affiliation: Facebook AI Research Email: Baptiste Roziere* Affiliation: Facebook AI Research Affiliation: Paris-Dauphine University Email: Lowik Chanussot Affiliation: Facebook AI Research Email: Affiliation: Guillaume Lample Affiliation: Facebook AI Research Email: Affiliation:
Abstract
A transcompiler, also known as source-to-source translator, is a system that converts source code from a high-level programming language (such as C++ or Python) to another. Transcompilers are primarily used for interoperability, and to port codebases written in an obsolete or deprecated language (e.g. COBOL, Python 2) to a modern one. They typically rely on handcrafted rewrite rules, applied to the source code abstract syntax tree. Unfortunately, the resulting translations often lack readability, fail to respect the target language conventions, and require manual modifications in order to work properly. The overall translation process is time-consuming and requires expertise in both the source and target languages, making code-translation projects expensive. Although neural models significantly outperform their rule-based counterparts in the context of natural language translation, their applications to transcompilation have been limited due to the scarcity of parallel data in this domain. In this paper, we propose to leverage recent approaches in unsupervised machine translation to train a fully unsupervised neural transcompiler. We train our model on source code from open source
原文 arXiv:2006.03511;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2006.03511v3