Cross-Language Code Development with Generative AI: A Source-to-Source Translation Perspective
Laxmisha Rai, Smriti Khatiwada, Chunrao Deng, Fasheng Liu · 2024
Since the release of ChatGPT in November 2022, there is growing interest around the world on exploring the capabilities of generative AI tools. In addition to text, image, audio, and video generation, these tools are also able to generate program codes. In this paper, strategies for students, programmers and enthusiasts to understand the prompting methods to generate codes in multiple languages by translating source code written in one language to another target language using generative AI is explored. The prompts are created to test the ability of generative AI to create codes in C, Java, C++, and Python. Some of the methods of generating the complete program using limited original source code statements is presented. In summary, while generating source code in a target language, generative AI tools downplay the significance of accuracy of statements written in original language, syntax, semantics, as well as missing statements in a program. Irrespective of these, generative AI tools are still able to generate complete code in a target language by correcting errors.