arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.05652cs.SE
收藏

StmtTree:一款易用且功能多样的Fortran转换工具包

StmtTree: An Easy-to-Use yet Versatile Fortran Transformation Toolkit

Jingbo Lin, Yi Yu, Zhang Yang, Yafan Zhao

AI总结:

针对旧Fortran代码维护与现代化难度大的问题,提出StmtTree工具包,通过语句树抽象结合高低层接口简化定制转换工具开发,实验验证其适配遗留代码且开发效率高。

摘要:

Fortran编程语言在科学计算领域仍占据主导地位,许多生产代码采用过时的Fortran-77方言编写,还包含Cray指针等大量非标准扩展。这给该领域带来了沉重的维护负担,大量精力被投入到代码现代化工作中。然而,尽管如今已有先进的编译器框架,处理和转换旧Fortran代码仍然颇具挑战。本文提出了一款新型Fortran代码转换工具包StmtTree以解决这一问题。StmtTree将Fortran语法抽象为语句树,既提供底层表示操作API,也具备高层且易用的查询与操作迷你语言,能够简化定制化Fortran转换工具的开发。实验表明,StmtTree能很好地适配遗留Fortran-77代码,开发移除未使用语句这类复杂工具仅需不到100行Python代码。

英文摘要:

The Fortran programming language continues to dominate the scientific computing community, with many production codes written in the outdated Fortran-77 dialect, yet with many non-standard extensions such as Cray poiters. This creates significant maintenance burden within the community, with tremendous efforts devoted to modernization. However, despite the modern age of advanced compiler frameworks, processing and transforming old Fortran codes remains challenging. In this paper, we present StmtTree, a new Fortran code transformation toolkit to address this issue. StmtTree abstracts the Fortran grammar into statement tree, offering both a low-level representation manipulation API and a high-level, easy-to-use query and manipulation mini-language. StmtTree simplifies the creation of customized Fortran transformation tools. Experiments show that StmtTree adapts well to legacy Fortran-77 codes, and complex tools such as removing unused statements can be developed with fewer than 100 lines of python code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑