TransCoder: Facebook’s Unsupervised Programming Language Translator

How Facebook Built a Transcompiler using Deep Learning

Rohan Jagtap
The Startup

--

Facebook AI Research (FAIR), recently published their paper, ‘Unsupervised Translation of Programming Languages’, which addresses transcompilation, i.e. translation between source codes of different languages.

A transcompiler, transpiler, or source-to-source compiler, is a translator which converts between programming languages that operate at a similar level of abstraction.

— from the paper

In this article, we will discuss the working of the TransCoder model and see how it performed. But first, let’s just quickly glance through the traditional transcompilation approaches, whose improvement is the motivation for applying deep learning.

  1. The initial intent of transcompilers was to achieve code portability i.e. cross-platform support. This was done by converting the code from a higher-level language to a relatively lower-level language (machine code or assembly language).
  2. Modern transcompilers come along with the new languages (TypeScript, Dart, etc.) and they convert these languages to the corresponding omnipresent languages.

--

--

Rohan Jagtap
The Startup

Immensely interested in AI Research | I read papers and post my notes on Medium