当前位置: X-MOL 学术J. Supercomput. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Making legacy Fortran code type safe through automated program transformation
The Journal of Supercomputing ( IF 3.3 ) Pub Date : 2021-07-14 , DOI: 10.1007/s11227-021-03839-9
Wim Vanderbauwhede 1
Affiliation  

Fortran is still widely used in scientific computing, and a very large corpus of legacy as well as new code is written in FORTRAN 77. In general this code is not type safe, so that incorrect programs can compile without errors. In this paper, we present a formal approach to ensure type safety of legacy Fortran code through automated program transformation. The objective of this work is to reduce programming errors by guaranteeing type safety. We present the first rigorous analysis of the type safety of FORTRAN 77 and the novel program transformation and type checking algorithms required to convert FORTRAN 77 subroutines and functions into pure, side-effect free subroutines and functions in Fortran 90. We have implemented these algorithms in a source-to-source compiler which type checks and automatically transforms the legacy code. We show that the resulting code is type safe and that the pure, side-effect free and referentially transparent subroutines can readily be offloaded to accelerators.



中文翻译:

通过自动程序转换使遗留 Fortran 代码类型安全

Fortran 仍然广泛用于科学计算,并且在 FORTRAN 77 中编写了大量的遗留代码和新代码。一般来说,这些代码不是类型安全的,因此不正确的程序可以编译而不会出错。在本文中,我们提出了一种通过自动化程序转换来确保遗留 Fortran 代码类型安全的正式方法。这项工作的目标是通过保证类型安全来减少编程错误。我们首次对 FORTRAN 77 的类型安全性进行严格分析,以及将 FORTRAN 77 子例程和函数转换为 Fortran 90 中纯的、无副作用的子例程和函数所需的新程序转换和类型检查算法。我们已在一个源到源编译器,它类型检查并自动转换遗留代码。

更新日期:2021-07-14
down
wechat
bug