LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study

Nishath Rajiv Ranasinghe, Shawn M. Jones, Michal Kucer, Ayan Biswas, Daniel O’Malley, Alexander Most, Selma Liliane Wanna, Ajay Sreekumar


Abstract
Large Language Models (LLMs) are increasinglybeing leveraged for generating andtranslating scientific computer codes by bothdomain-experts and non-domain experts. Fortranhas served as one of the go to programminglanguages in legacy high-performance computing(HPC) for scientific discoveries. Despitegrowing adoption, LLM-based code translationof legacy code-bases has not been thoroughlyassessed or quantified for its usability.Here, we studied the applicability of LLMbasedtranslation of Fortran to C++ as a step towardsbuilding an agentic-workflow using openweightLLMs on two different computationalplatforms. We statistically quantified the compilationaccuracy of the translated C++ codes,measured the similarity of the LLM translatedcode to the human translated C++ code, andstatistically quantified the output similarity ofthe Fortran to C++ translation.
Anthology ID:
2025.aisd-main.6
Volume:
Proceedings of the 1st Workshop on AI and Scientific Discovery: Directions and Opportunities
Month:
May
Year:
2025
Address:
Albuquerque, New Mexico, USA
Editors:
Peter Jansen, Bhavana Dalvi Mishra, Harsh Trivedi, Bodhisattwa Prasad Majumder, Tom Hope, Tushar Khot, Doug Downey, Eric Horvitz
Venues:
AISD | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
58–69
Language:
URL:
https://aclanthology.org/2025.aisd-main.6/
DOI:
Bibkey:
Cite (ACL):
Nishath Rajiv Ranasinghe, Shawn M. Jones, Michal Kucer, Ayan Biswas, Daniel O’Malley, Alexander Most, Selma Liliane Wanna, and Ajay Sreekumar. 2025. LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study. In Proceedings of the 1st Workshop on AI and Scientific Discovery: Directions and Opportunities, pages 58–69, Albuquerque, New Mexico, USA. Association for Computational Linguistics.
Cite (Informal):
LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study (Ranasinghe et al., AISD 2025)
Copy Citation:
PDF:
https://aclanthology.org/2025.aisd-main.6.pdf