Compile-time disambiguation of MATLAB types through concrete interpretation with automatic run-time fallback

Chun-Yu Shei, Arun Chauhan, Sidney L. Shaw · 2009

While the popularity of MATLAB for scientific and engineering applications is unabated, its poor performance compared to traditional languages, such as Fortran or even C, for a general class of problems continues to impede its deployment in full-scale simulations and data analysis. To ameliorate performance, we have been developing a MATLAB and Octave compiler that leverages the interpreter to implement some of the optimizations as concrete partial evaluations. Specifically, this paper describes constant propagation and type inference, using a high-level tree-transformation tool that has built-in support for solving dataflow problems. The approach allows propagation and folding of constants in cases that would be impractically difficult otherwise. The idea, when extended to infer variable types, provides a natural way to disambiguate types at compile time while leaving the fallback code in place for run-time evaluation. Experimental evaluation on pieces of real MATLAB code demonstrates the effectiveness of the approach.

Read the paper · More papers on PaperTik