Transcoder: Translate C++ to Python

Authors

  • Divyanshi Agarwal Student, Department of Computer science and Engineering, Poornima College of Engineering, Sitapura, Jaipur, Rajasthan, India
  • Ayush Baluni Student, Department of Computer science and Engineering, Poornima College of Engineering, Sitapura, Jaipur, Rajasthan, India
  • Avinash Dubey Student, Department of Computer science and Engineering, Poornima College of Engineering, Sitapura, Jaipur, Rajasthan, India
  • Ankit Kumar Student, Department of Computer science and Engineering, Poornima College of Engineering, Sitapura, Jaipur, Rajasthan, India
  • Mithlesh Arya Assistant Professor, Department of Computer science and Engineering, Poornima College of Engineering, Sitapura, Jaipur, Rajasthan, India

Keywords:

Programming language, Python, interpreter, transcoder

Abstract

In computer science, there are different programming languages but the logic to implement a particular code remains same in every language. Many people have code bases in outdated programming languages like COBOL and switching those bases to more modern ones like Java, C++, or Python requires a significant investment of time and resources. Transcoder can conserve a lot of resources in the situation. This is a pilot project that we designed to translate a program from C++ to Python and vice versa. Two common and reliable programming languages used nowadays are C++ and Python. These two languages each have their own benefits and drawbacks. Python is an interpreted programming language; hence it requires an interpreter to be compiled. C++, on the other hand, is a pre-compiled programming language and does not require interpreter at the time of compilation. Due to Python's phenomenal growth and popularity year after year, this enables straight automatic translation rather than developing a Python program from start.

References

Rolim R, Soares G, D’Antoni L, Polozov O, Gulwani S, Gheyi R, Suzuki R, Hartmann B. Learning syntactic program transformations from examples. In Proc of 39th Int Conf on Softw Eng, ser ICSE’17; Piscataway, NJ, USA: IEEE Press; 2017; 404–415.

Hata H, Shihab E, Neubig G. Learning to generate corrective patches using neural machine translation. arXiv preprint arXiv:1812.07170. 2018 Dec 18.

Roziere B, Lachaux MA, Chanussot L, Lample G. Unsupervised translation of programming languages. Advances in Neural Information Processing Systems. 2020;33:20601–11.

Karan Aggarwal, Mohammad Salameh, Abram Hindle. Using machine translation for converting python 2 to python 3 code. Technical report, PeerJ PrePrints. 2015; 3: e1459v1.

Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. Codebert: A pre-trained model for programming and natural languages. arXiv preprint arXiv:2002.08155. 2020.

Fu C, Chen H, Liu H, Chen X, Tian Y, Koushanfar F, Zhao J. Coda: An end-to-end neural program decompiler. Advances in Neural Information Processing Systems. 2019;32.

Garg A, Agarwal M. Machine Translation: A Literature Review. arXiv [cs.CL]. 2018.

Taha Yunus Moochhala, Kamalraj R. Translation of Natural Language to Code: A Survey. International Journal of Engineering Applied Sciences and Technology (IJEAST). 2021; 6(8): 191–195.

Shirvi Nisha N, Panchal Mahesh H. Translation of English Algorithm in C Program using Syntax Directed Translation Schema. International Journal of Computer Science and Mobile Computing-IJCSMC (Vol.3, No. 2); 752–760; 2014.

Lachaux MA, Roziere B, Chanussot L, Lample G. Unsupervised translation of programming languages. arXiv preprint arXiv:2006.03511. 2020 Jun 5.

Published

2023-06-14