Title :
Mc2FOR demo: A tool for automatically translating MATLAB to FORTRAN 95
Author :
Xu Li ; Hendren, Laurie
Author_Institution :
Sch. of Comput. Sci., McGill Univ., Montréal, QC, Canada
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.
Keywords :
FORTRAN; Java; authoring languages; program compilers; program interpreters; public domain software; FORTRAN 95-compliant compiler; FORTRAN function file compilation; Fortran construct mapping; Java; Matlab built-in function mapping; Matlab construct mapping; Matlab dynamic types; Matlab entry point function file; Matlab high-level syntax; Mc2FOR tool; McLab framework; automatic program translation; distributable code; dynamic numerical scripting language; high-performance static languages; input parameters; open source tool; static type characteristics estimation; Approximation algorithms; Arrays; Java; MATLAB; Shape; Transforms; Vectors;
Conference_Titel :
Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE), 2014 Software Evolution Week - IEEE Conference on
Conference_Location :
Antwerp
DOI :
10.1109/CSMR-WCRE.2014.6747218