6 tools to translate code between programming languages

0


Converting syntax between programming languages ​​is not the only way to convert code from one language to another. It is the process of transforming data while preserving structure as much as possible. Recent research states that migrating an existing code base to a more current or efficient language, such as Java or C ++, requires skills in both the source and destination languages ​​and can be expensive. The Commonwealth Bank of Australia, for example, spent approximately $ 750 million over five years to move its platform from COBOL to Java. In principle, a transcompiler can save time by eliminating the need to rewrite code from scratch. However, they are difficult to implement in practice because different languages ​​have different syntaxes and are based on different platform APIs, standard library functions, and variable types.

Obstacle

Migrating legacy code to another programming language can be accomplished at different levels, each more ambitious and more difficult to implement. As a result, as we progress through the levels, the need for manual conversion increases. At the most basic level, migration is the process of converting code from one language to another. At a higher level, the structure of the system can be changed, for example, by converting code written in a pure language. procedural language to code written in a pure object oriented language. At even higher levels, the overall architecture may need to be changed. It is becoming increasingly difficult to maintain consistency between different languages ​​as new technologies emerge on a daily basis. New features are also introduced as programming languages ​​advance. Therefore, all cross-conversion compilers related to this language must be updated.

Register for our upcoming Masterclass>>

For example, Georges et al. express that, every 3 to 5 years, ANSI C ++ Is updated. New keywords can be included in the modified wording. For example, constexpr is a new keyword in ANSI C ++ 0x. Therefore, all identifiers with the same name in the first few applications must be updated, otherwise they will be misinterpreted.

Existing transcompilation tools

Let’s take a look at some of the tools available for translating code between programming languages.

JLCA – Java Language Conversion Assistant is a tool that automatically translates current Java code into Visual c # coded.

Looking for a job change? Let us help you.

BCX – BCX is a small command line tool that takes a BCX BASIC source code file and converts it to a “C” source code file that can be compiled with any C or C ++ compiler.

PERTHON – Perthon translates the Python source code into Perl 5.x source code that humans can read. It parses using Parse :: Rec Descent by Damian Conway and seeks to reimplement the Python language according to the Python reference manual and BNF grammar.

Google’s GWT – With GWT you can build and debug AJAX applications in Java using your favorite Java development tools. The GWT compiler converts your Java application to JavaScript browser compatible and HTML when you push it into production.

See also

Facebook hip-hop – HipHop compiles your PHP source code using g ++ after programmatically converting it to highly efficient C ++.

TransCoder from Facebook AI – TransCoder, a Facebook system that can translate between C ++, Java, and Python, takes an unsupervised learning approach to the problem. Transcoder start with multilingual linguistic model pre-training, which converts code fragments expressing the same instructions into equivalent representations regardless of the programming language.

Future progress

The goal of programmers is to achieve maximum conversion efficiency without sacrificing the quality of the converted system. Even though the language conversion looks straightforward, it is a herculean task with many complexities. It is rightly considered one of the top ten programming challenges the world faces. Even before reliability semi-automatic converter is accessible, much progress needs to be made. It may even be possible in the future to translate code between two entirely separate platforms with just one click. Because a library alone cannot perform such a flawless conversion and spot the replacement model in the language, it may depend on the advancement of artificial intelligence. Converting a desktop program to a web application and vice versa is a good example. Likewise, the reasoning used to design a desktop or similar web app can be applied to build mobile apps. Therefore, we can expect a competent transcompiler from the research community in the near future.


Join our Discord server. Be part of an engaging online community. Join here.


Subscribe to our newsletter

Receive the latest updates and relevant offers by sharing your email.

Dr Nivash Jeevanandam

Dr Nivash Jeevanandam

Nivash holds a doctorate in information technology. He worked as a research associate in a university and as a development engineer in the computer industry. He is passionate about data science and machine learning.


Share.

About Author

Leave A Reply