High-performance runtime for math

RunMat lets you compile and run math written in MATLAB syntax. It runs on CPUs and on NVIDIA, AMD, Intel and Apple GPUs, on macOS, Windows, Linux and in the browser.

v0.7.2 released 2026-11-26 · Release notes

Four drones scan mountain terrain with LIDAR and build a point-cloud map. The map smears as their position estimates drift, then snaps into alignment after a loop closure; side plots show position error dropping at each map sync, marked by a dotted line, and map coverage rising.
Example: four drones, simulated in RunMat, scan unknown terrain and build a 3D map while localizing themselves. Each time they fly back over ground already mapped, they recognize it, share their maps, correct their accumulated drift and snap the map into alignment.

Install CLI

$curl -fsSL https://runmat.com/install.sh | sh

macOS (Apple silicon, Intel) · Windows x64 · Linux x64

Download the desktop appAll install options

License

RunMat is licensed under the Business Source License 1.1, and each version converts to Apache 2.0 three years after it is first published. The source code is available on GitHub.

Source on GitHubFree use grantLicense details

GPU and fusion

RunMat runs array code on the GPU wherever it is faster than the CPU, with no GPU code to write. It combines the eight operations on line 2 of the example below into one kernel, so the GPU reads x once and writes y once, with no temporary arrays in between.

gpu_example.m
x = rand(1e8, 1, "single");
y = exp(-x) .* sin(4*x) + tanh(x).^2;
s = sum(y);
  • Fuses elementwise math and reductions into single kernels
  • Chooses the CPU or GPU for each piece of work from its size and transfer cost
  • Keeps results in GPU memory between statements
  • NVIDIA, AMD, Intel and Apple GPUs, through Metal, DirectX 12, Vulkan and WebGPU
  • gpuArray and gather work as written when you want control

More on GPU accelerationBenchmark method

GPU kernels
1
Temporary arrays
None
ONE GPU KERNELEIGHT GPU KERNELSx-x4*xtanhexpsin.^2.*+y
CPU495 ms
GPU125 ms
4.0× faster on the GPU100 million elements · Apple M5 Max · 2026-10-14

Strong static analysis and type checks

RunMat analyzes code before it runs. It works out the type and size of every value and reports the mistakes it can prove, with the line, an error code and what to do about it.

  • Mismatched array sizes in arithmetic, division and concatenation
  • Variables that may be unset on some paths through the code
  • Misspelled or missing functions, checked against built-ins and your project
  • The same checks in the editor as you type, and in CI with runmat check

Static analysisrunmat check in the CLI

sizes.m
A = [1 2 3; 4 5 6];
B = [1 2; 3 4];
C = A + B;
terminal
$ runmat check sizes.m
error[RM-TYPE-BROADCAST]: dimensions 3 and 2 are not compatible for implicit expansion
--> sizes.m:3:1
|
3 | C = A + B;
| ^^^^^^^^^ static value contract is not satisfied here
checked sizes.m: 1 error(s), 0 warning(s)

Language and functions

Language

  • double, single, all eight integer classes, logical, complex, sparse
  • Strings, chars, cells, structs, tables, timetables, datetime
  • Functions, closures, varargin, arguments blocks, nested functions
  • classdef: handle classes, events, enumerations, inheritance
  • Packages: +pkg, @Class, private, import
  • parfor and spmd
  • try/catch with MATLAB error identifiers

Run runmat check on a codebase to find anything in it that RunMat doesn't support yet. It uses the same static analysis as the editor.

Migration guide

Why MATLAB syntax?

Why did RunMat choose MATLAB syntax as its input?

  • Arrays and matrices are built into the language, so code reads like the equations it implements
  • Linear algebra, signal processing, statistics, ODE solvers and plotting included
  • Taught in engineering and science programs, with decades of published code and textbooks
  • Short programs that AI models can write, and RunMat checks them before running
The mathThe code
x=[123]x = \begin{bmatrix} 1 & 2 & 3 \end{bmatrix}
x = [1 2 3];
A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
A = [1 2; 3 4];
y=Ax+by = A x + b
y = A*x + b;
C=A⊤BC = A^{\top} B
C = A' * B;
x=A−1bx = A^{-1} b
x = A \ b;
s=∑ixi2s = \textstyle\sum_i x_i^2
s = sum(x.^2);

Command-line tools

The runmat command checks, tests, packages and compiles your code.

  • Static checks to run in CI
  • MATLAB-style unit tests with JUnit and coverage reports
  • A package manager with a lockfile
  • A language server that shows inferred sizes and types
  • Standalone executables with runmat compile

CLI reference

terminal
$ runmat check main.m
checked main.m: 0 error(s), 0 warning(s)
$ runmat test
3 tests: 3 passed, 0 failed, 0 incomplete
$ runmat accel-info
Device: Apple M5 Max (metal)

Why teams choose RunMat

If you already write MATLAB

Keep your code
Run your existing .m files without rewriting them in another language.
Use the GPU you have
NVIDIA, AMD, Intel or Apple, with no toolbox to buy.
Read the source
The source is public. Read it, build it from source and modify it.
No license server
Free for individuals, academia, open-source contributors and smaller organizations.

If you're choosing a language

Fast code in one language
The compiler and GPU speed up the same code, so hot paths are not rewritten in C or CUDA.
Errors caught early
Size and type errors show up in the editor and in CI.
Laptop to cluster
The same code runs in the browser, in CI containers, on cluster nodes and as compiled executables.
Math and simulation together
Simulations, sweeps and plots live in the same scripts as the rest of your work.

Use with your existing AI apps

Connect RunMat to Claude Code, Codex or another MCP client, and the AI tool you already use writes MATLAB-language code and runs it in RunMat. RunMat checks sizes and types before the code runs, the output comes back to the agent, and the figures appear in RunMat Desktop.

Connect your AI toolRead the agent docs

Releases

  1. v0.6.2

    • Standalone executables with runmat compile
    • Exact integer classes on CPU, GPU and sparse
    • Shared static analysis across compiler, editor and JIT
    • Cost-based CPU and GPU placement
    • Encrypted remote jobs and cluster nodes
  2. v0.6.1

    • Color output for CLI diagnostics
    • Functions on addpath callable at once
  3. v0.6.0

    • Tables and timetables
    • Argument validation with mustBe* functions
    • runmat check on the shared static analysis

Full changelog