Facebook’s TransCoder AI tool can convert code from one Programming language to another

0

Now you can use Facebook’s TransCoder AI tool that converts code from any programming language to another

As you can see how Facebook has promoted itself in the pandemic by helping users to work from home from its newly launched Messanger Rooms. The company has done multiple changes in its family apps and itself and made it easier for users around the world to stay at home and work efficiently. Well, now Facebook is all set to release a TransCoder AI that will make developers convert code from one Programing Language to another easily.

Researchers from Facebook said that they’ve developed a neural transcompiler, a system that converts code from one high-level programming language like C++, Java, and Python into another. As you know Migrating an existing code to efficient languages like Java or C++ is often costly.

These Transcompliers eliminate the need to rewrite code from scratch but as a note, they are difficult to build because different languages can have a different syntax, standard-library functions, and variable types which can make the code useless. But this Facebook’s TransCoder AI can translate between C++, Java, and Python and tackles the challenge with an unsupervised learning approach. A process called denoising auto-encoding trains the system to generate valid sequences even when fed with noisy input data, and back-translation allows TransCoder to generate parallel data that can be used for training.

To evaluate TransCoder’s performance, the researchers extracted 852 parallel functions in C++, Java, and Python from GeeksforGeeks, an online platform that gathers coding problems and presents solutions in several programming languages. Using these, they developed a new metric computational accuracy that tests whether hypothesis functions generate the same outputs as a reference when given the same inputs.

TransCoder can easily be generalized to any programming language, does not require any expert knowledge, and outperforms commercial solutions by a large margin. Our results suggest that a lot of mistakes made by the model could easily be fixed by adding simple constraints to the decoder to ensure that the generated functions are syntactically correct, or by using dedicated architectures.

the Facebook CO Authors wrote.

The Translations noted by the Facebook researchers by converting code from one programming language to another is below:

  • When translating from Java to C++, 91.6% of TransCoder’s generations returned the expected outputs.
  • When translating from Java to Python, 68.7% of TransCoder’s generations returned the expected outputs.
  • When translating from C++ to Java, 74.8% of TransCoder’s generations returned the expected outputs.
  • When translating from C++ to Python, 67.2% of TransCoder’s generations returned the expected outputs.
  • When translating from Python to Java, 56.1% of TransCoder’s generations returned the expected outputs.
  • When translating from Python to C++, 57.8% of TransCoder’s generations returned the expected outputs.

While we cannot expect a complete translation rate but soon the technology will pace up and the day won’t be far that would help developers converting the code from one programming language to another. What are your views on Facebook’s TransCoder AI? Do mention your valuable views in the comment section below. To stay updated on Tech and Cybersecurity news subscribe to our newsletter from here

Share.

About Author

Be Ready for the challenge

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments