Mc2FOR demo: A tool for automatically translating MATLAB to FORTRAN 95

Xu Li, L. Hendren
{"title":"Mc2FOR demo: A tool for automatically translating MATLAB to FORTRAN 95","authors":"Xu Li, L. Hendren","doi":"10.1109/CSMR-WCRE.2014.6747218","DOIUrl":null,"url":null,"abstract":"MATLAB is a dynamic numerical scripting language widely used by scientists, engineers and students. While MATLAB'S high-level syntax and dynamic types makes it ideal for prototyping, programmers often prefer using high-performance static languages such as FORTRAN for their final distributable code. Rather than requiring programmers to rewrite their code by hand, our solution is to provide a tool that automatically translates the original MATLAB program to an equivalent FORTRAN program. There are several important challenges for automatically translating MATLAB to FORTRAN, such as correctly estimating the static type characteristics of all the variables in a MATLAB program, mapping MATLAB built-in functions, and effectively mapping MATLAB constructs to FORTRAN constructs. In this tool demonstration, we introduce the tool Mc2FOR, a mature prototype which automatically translates MATLAB programs to FORTRAN. This tool takes as input a MATLAB entry point function file of a program with corresponding information of its input parameters, then automatically finds all functions reachable directly or indirectly from the entry point, loads the necessary files, and translates all the reachable MATLAB functions to equivalent FORTRAN. The output of the tool is a collection of FORTRAN function files, which can be compiled with any FORTRAN 95-compliant compiler. Mc2FOR is open source, and has been implemented in Java using the McLab framework, which means that the tool runs on any system supporting Java.","PeriodicalId":166271,"journal":{"name":"2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CSMR-WCRE.2014.6747218","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

MATLAB is a dynamic numerical scripting language widely used by scientists, engineers and students. While MATLAB'S high-level syntax and dynamic types makes it ideal for prototyping, programmers often prefer using high-performance static languages such as FORTRAN for their final distributable code. Rather than requiring programmers to rewrite their code by hand, our solution is to provide a tool that automatically translates the original MATLAB program to an equivalent FORTRAN program. There are several important challenges for automatically translating MATLAB to FORTRAN, such as correctly estimating the static type characteristics of all the variables in a MATLAB program, mapping MATLAB built-in functions, and effectively mapping MATLAB constructs to FORTRAN constructs. In this tool demonstration, we introduce the tool Mc2FOR, a mature prototype which automatically translates MATLAB programs to FORTRAN. This tool takes as input a MATLAB entry point function file of a program with corresponding information of its input parameters, then automatically finds all functions reachable directly or indirectly from the entry point, loads the necessary files, and translates all the reachable MATLAB functions to equivalent FORTRAN. The output of the tool is a collection of FORTRAN function files, which can be compiled with any FORTRAN 95-compliant compiler. Mc2FOR is open source, and has been implemented in Java using the McLab framework, which means that the tool runs on any system supporting Java.
Mc2FOR演示:一个自动将MATLAB转换为FORTRAN 95的工具
MATLAB是一种动态数值脚本语言,被科学家、工程师和学生广泛使用。虽然MATLAB的高级语法和动态类型使其成为原型设计的理想选择,但程序员通常更喜欢使用高性能静态语言,如FORTRAN来编写最终的可分发代码。我们的解决方案是提供一个工具,可以自动将原始MATLAB程序转换为等效的FORTRAN程序,而不是要求程序员手工重写代码。自动将MATLAB转换为FORTRAN有几个重要的挑战,如正确估计MATLAB程序中所有变量的静态类型特征,映射MATLAB内置函数,以及有效地将MATLAB构造映射到FORTRAN构造。在这个工具演示中,我们介绍了Mc2FOR工具,它是一个成熟的原型,可以自动将MATLAB程序转换为FORTRAN。该工具以程序的MATLAB入口点函数文件及其输入参数的相应信息为输入,自动查找从该入口点直接或间接可达的所有函数,加载必要的文件,并将所有可达的MATLAB函数翻译成等效的FORTRAN。该工具的输出是FORTRAN函数文件的集合,可以用任何FORTRAN 95兼容的编译器进行编译。Mc2FOR是开源的,并且使用McLab框架在Java中实现,这意味着该工具可以在任何支持Java的系统上运行。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信