Transcoder, Transpiler, Transcompiler | C2C Community

Transcoder, Transpiler, Transcompiler

  • 17 November 2021
  • 0 replies
  • 1123 views

Towards the Innovation
Introduction and Scope:

Idea: Transcoder, Transpiler, Transcompiler

A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a programming language as its input and produces an equivalent source code in the same or a different programming language.

TRANSCODER: a language conversion model

1)    algorithm (FLOWCHART) maker from code

2)    code analysis (code checker)

3)    code converter (from python to C, C++, Python, Java, PHP, Ruby, Perl,

4)    C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.

The tool is based on AI (artificial intelligence) , the idea is to convert code in a high level language such as C++ , java ,python

RESOURCES:

No alt text provided for this image

 

COMPILER:

transcompiler, also called a source-to-source compiler or transpiler, is a special type of compiler that converts a program's source code into another language. It can also process a program written in an older version of a programming language, converting it to a newer version of the same language

DESCRIPTION:

The process starts with a pre-training that maps instructions from a code that is the same in the target and source languages. “Anchor points” common to many languages, examples of statements like “if or” while “and mathematical operators, serve as the basis for this work.

A “back-translation” process, that is, converting the code back to the first language, allows Transcoder to generate parallel data to be compared to the original ones. The differences found in this process reinforce the training.

 

Background Idea:

The Main idea behind the concept of transcompiler/transcoder/code convert is being represented by a picture below

No alt text provided for this image

 

Source description:

 

 

Existing Reference:

Facebook Transcoder uses AI to convert between C ++, Java and Python

 

Facebook researchers have developed an AI system that converts code from one language to another. Transcoder is a new language conversion model developed by Facebook researchers. The AI-based tool converts high-level languages such as C++, Java, and Python into another.

Transcompiler tools help in ensuring that the new code does not need to be rewritten from scratch. The advantages do not go beyond this. It is still a complex task for a developer to deal with syntax differences, library changes, and AI adaptation.

Problem Statement:

WHAT PROBLEMS DOES A TRANSCODER SOLVE?

  •  Migration:

if you have legacy code you want to migrate to some platform with better capabilities or for which it is easier to find hardware or support. For example, your code is written in COBOL and runs on some mainframe. The cost of your MIPS (Million instructions per second) is killing you. Or your code is written in Java or C++, and you would like to move to the Python to take advantage of many more libraries.

  •  Compatibility:

you need your code to be compatible with certain other systems. For example, browsers support exclusively JavaScript. So, if you want to run your code in the browser and it is not written in JavaScript, you can then transpile it to JavaScript. Another case is when you want to have compatibility with different versions of a compiler or interpreter. You may want to transpiler your Python 2 code to Python 3, for example. Or you modern JavaScript code to a previous version of JavaScript, so that it is more widely supported.

  •  Coding skills:

sometimes the problem is that your code is written in a language that no one knows anymore. In that case, you may want to translate it to a more common language so that it is easier to find the competencies to maintain and evolve it. For example, if your code is written in a long-forgotten 4GL language you may want to translate it to python, Java or C#.

  •   Performance:

 Another reason to perform a transpilation is to target a faster language. For example, for a client of ours we wrote a transpiler from

python to C++, so that the resulting code was significantly faster.

  • Algorithm Required

Neural machine translation https://medium.com/@ahlawat.randeep/translating-c-to-python-using-neural-machine-translation-acb834308baf

Transcoder GitHub official Repository

https://www.geeksforgeeks.org/facebook-transcoder/

  • Data sets:
  1.  Geek for Geek
  2. Stack over flow
  3. W3school
  4. GitHub
  • Languages Involved:
  1. Python
  2.  C++, C
  3. Java, JavaScript
  4.  PHP
  5. Perl
  6. Ruby
  •  Research paper:

The most important research paper I have found on scholar.google.com

Are as follows:

 


0 replies

Be the first to reply!

Reply