kirancodes.me
To Proof Maintenance & Beyond!

A stage-polymorphic IR for compiling MATLAB-style dynamic tensor expressions

Alen Stojanov, Tiark Rompf, Markus Püschel

Abstract

We propose a novel approach for compiling MATLAB and similar languages that are characterized by tensors with dynamic shapes and types. We stage an evaluator for a subset of MATLAB using the Lightweight Modular Staging (LMS) framework to produce a compiler that generates C code. But the first Futamura projection alone does not lead to efficient code: we need to refine the rigid stage distinction based on type and shape inference to remove costly runtime checks.

Related papers