Tanscoder AI is a neural transcompiler developed by Facebook researchers, which can easily convert source code from one high-level programming language to another.
While the migration of existing codebase to a more modern language requires huge amount of resources, both in manpower and finances; making use of transcompilers can help to eliminate the amount of expenses involved in rewriting the codes from scratch.
The neural transcompiler, TransCoder AI can convert codes between high-level programming languages such as C++, Java, and Python.
How Accurate is TransCoder AI?
Facebook researchers have trained TransCoder AI using a publicly available code within over 2.8 million open-source repositories on GitHub to focus on code translation at the very functional level.
While for the evaluation of the performance of TransCoder AI, the researchers chose 852 parallel functions in C++, Java and Python from a popular platform that teaches coding through problems and offering solutions in different programming languages, known as GeeksforGeeks.
The above two data were used to develop a new metric called “computational accuracy” to check if translated functions generate the same outputs with the inputs as it did in the original source language.
And the accuracy level in results obtained by TransCoder AI during conversion of codes from C++ to Java is 74.8%; C++ to Python is 67.2%; Java to C++ is 91.6%; Java to Python is 68.7%; Python to Java is 56.1%; and Python to C++ is 57.8%!
Why TransCoder AI for the Conversion of Programming Languages?
As the migration of existing codebase to a more efficient language requires a huge amount of resources, making use of transcompilers can help to eliminate the amount of expenses involved in rewriting the codes.
But neural transcompilers are quite difficult to build in practice as a result of the fact that source and target language have differences in syntax, standard-library functions, variable types, and platform APIs.
TransCoder AI will help to tackle these challenges with an unsupervised learning approach, which can run with a minimal amount of intervention to find hidden patterns in data sets and outperform rule-based baselines by a wide margin.