skip to main content
10.1145/2048066.2048077acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Kind analysis for MATLAB

Published: 22 October 2011 Publication History

Abstract

MATLAB is a popular dynamic programming language used for scientific and numerical programming. As a language, it has evolved from a small scripting language intended as an interactive interface to numerical libraries, to a very popular language supporting many language features and libraries. The overloaded syntax and dynamic nature of the language, plus the somewhat organic addition of language features over the years, makes static analysis of modern MATLAB quite challenging. A fundamental problem in MATLAB is determining the kind of an identifier. Does an identifier refer to a variable, a named function or a prefix? Although this is a trivial problem for most programming languages, it was not clear how to do this properly in MATLAB. Furthermore, there was no simple explanation of kind analysis suitable for MATLAB programmers, nor a publicly-available implementation suitable for compiler researchers.
This paper explains the required background of MATLAB, clarifies the kind assignment program, and proposes some general guidelines for developing good kind analyses. Based on these foundations we present our design and implementation of a variety of kind analyses, including an approach that matches the intended behaviour of modern MATLAB 7 and two potentially better alternatives.
We have implemented all the variations of the kind analysis in McLab, our extensible compiler framework, and we present an empirical evaluation of the various analyses on a large set of benchmark programs.

References

[1]
G. Almási and D. Padua. MaJIC: compiling MATLAB for speed and responsiveness. In PLDI '02: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pages 294--303, New York, NY, USA, 2002. ACM.
[2]
M. Chevalier-Boisvert, L. Hendren, and C. Verbrugge. Optimizing MATLAB through Just-In-Time Specialization. In International Conference on Compiler Construction, pages 46--65, March 2010.
[3]
INRIA. Scilab, 2009. http://www.scilab.org/platform/.
[4]
P. G. Joisha and P. Banerjee. Correctly detecting intrinsic type errors in typeless languages such as MATLAB. In APL '01: Proceedings of the 2001 conference on APL, pages 7--21, New York, NY, USA, 2001. ACM.
[5]
J. Li. McFOR: A MATLAB to FORTRAN 95 compiler. Master's thesis, McGill University, Montreal, Canada, 2009.
[6]
MathWorks. MATLAB Documentation, 2010. http://www.mathworks.com/.
[7]
McLab. McLab. http://www.sable.mcgill.ca/mclab/.
[8]
Octave. GNU Octave. http://www.gnu.org/software/octave/index.html.
[9]
L. D. Rose and D. Padua. Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst., 21(2):286--323, 1999.

Cited By

View all
  • (2023)Application of the MQTT Protocol for the Control of a Scorbot Robot by Means of EGG Electroencephalographic SignalsCSEI: International Conference on Computer Science, Electronics and Industrial Engineering (CSEI)10.1007/978-3-031-30592-4_27(390-411)Online publication date: 1-May-2023
  • (2018)Profile-based vectorization for MATLABProceedings of the 5th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming10.1145/3219753.3219756(18-23)Online publication date: 19-Jun-2018
  • (2015)TypeDevilProceedings of the 37th International Conference on Software Engineering - Volume 110.5555/2818754.2818795(314-324)Online publication date: 16-May-2015
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
October 2011
1104 pages
ISBN:9781450309400
DOI:10.1145/2048066
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 46, Issue 10
    OOPSLA '11
    October 2011
    1063 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2076021
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 October 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. MATLAB
  2. kind analysis
  3. name resolution

Qualifiers

  • Research-article

Conference

SPLASH '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)13
  • Downloads (Last 6 weeks)1
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Application of the MQTT Protocol for the Control of a Scorbot Robot by Means of EGG Electroencephalographic SignalsCSEI: International Conference on Computer Science, Electronics and Industrial Engineering (CSEI)10.1007/978-3-031-30592-4_27(390-411)Online publication date: 1-May-2023
  • (2018)Profile-based vectorization for MATLABProceedings of the 5th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming10.1145/3219753.3219756(18-23)Online publication date: 19-Jun-2018
  • (2015)TypeDevilProceedings of the 37th International Conference on Software Engineering - Volume 110.5555/2818754.2818795(314-324)Online publication date: 16-May-2015
  • (2015)TypeDevil: Dynamic Type Inconsistency Analysis for JavaScript2015 IEEE/ACM 37th IEEE International Conference on Software Engineering10.1109/ICSE.2015.51(314-324)Online publication date: May-2015
  • (2014)MIX10ACM SIGPLAN Notices10.1145/2714064.266021849:10(617-636)Online publication date: 15-Oct-2014
  • (2014)MIX10Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660218(617-636)Online publication date: 15-Oct-2014
  • (2014)Mc2FOR: A tool for automatically translating MATLAB to FORTRAN 952014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE)10.1109/CSMR-WCRE.2014.6747175(234-243)Online publication date: Feb-2014
  • (2013)First steps to compiling Matlab to X10Proceedings of the third ACM SIGPLAN X10 Workshop10.1145/2481268.2481273(2-11)Online publication date: 20-Jun-2013
  • (2013)The MATISSE MATLAB compiler2013 11th IEEE International Conference on Industrial Informatics (INDIN)10.1109/INDIN.2013.6622952(602-608)Online publication date: Jul-2013
  • (2013)Enriching MATLAB with aspect-oriented features for developing embedded systemsJournal of Systems Architecture: the EUROMICRO Journal10.1016/j.sysarc.2013.04.00359:7(412-428)Online publication date: 1-Aug-2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media