Typing aspects for MATLAB

The MATLAB programming language is heavily used in many scientific and engineering domains. Part of the appeal of the language is that one can quickly prototype numerical algorithms without requiring any static type declarations. However, this lack of type information is detrimental to both the programmer in terms of software reliability and understanding, and to the compiler in terms of generating efficient code. This paper introduces the idea of adding typing aspects to MATLAB programs. A typing aspect can be used to: (1) capture the runtime types of variables, and (2) to check runtime types against either a declared type or against a previously captured runtime type. Typing aspects can be can be used: (1) solely as documentation, (2) to log type errors, or (3) to catch type errors at runtime.