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

Install CLI
macOS (Apple silicon, Intel) · Windows x64 · Linux x64
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.
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.
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
- GPU kernels
- 1
- Temporary arrays
- None
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
A = [1 2 3; 4 5 6];B = [1 2; 3 4];C = A + B;
$ runmat check sizes.merror[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 herechecked sizes.m: 1 error(s), 0 warning(s)
Parallel, compiled and mixed-language code
y = zeros(1, 1000);parfor k = 1:1000y(k) = simulate(k);end
Parallel
Runs multi-core and multi-machine calculations, with the same results at any worker count.
Explore parallel$ runmat compile main.m -o sim$ ./simmean 0.4995
Compile
Builds an executable that runs without RunMat installed.
Explore compiler = py.numpy.fft.fft(x);d = javaObject("java.util.Date");mex -output fastsum fastsum.c
Interop and MEX
Calls Python and Java, builds MEX files from source, and loads C libraries.
Explore interopLanguage 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.
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
- x = [1 2 3];
- A = [1 2; 3 4];
- y = A*x + b;
- C = A' * B;
- x = A \ b;
- 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
$ runmat check main.mchecked main.m: 0 error(s), 0 warning(s)$ runmat test3 tests: 3 passed, 0 failed, 0 incomplete$ runmat accel-infoDevice: 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.
Mix and match with the rest of RunMat
- Simulation Write loads, boundary conditions and geometry as MATLAB functions, and post-process every result with the same code you use for the rest of your analysis.
- MCAD Drive a part's dimensions from MATLAB code, such as a cam profile from its motion law, and optimize them against a stress or mass limit with every design solved in parallel.
- ECAD Compute part values in MATLAB code, such as a filter's resistors and capacitors from its cutoff frequency, and script sweeps and Monte Carlo runs against the circuit's spec.
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.
Releases
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
v0.6.1
- Color output for CLI diagnostics
- Functions on addpath callable at once
v0.6.0
- Tables and timetables
- Argument validation with mustBe* functions
- runmat check on the shared static analysis
Resources
- Getting started Install, first script, projects
- Migrate from MATLAB Check, fix, run and compare results
- Function reference Every built-in, with examples
- Language reference Values, types, functions and classes
- Compiler internals HIR, MIR, the VM, JIT and memory
- GPU and fusion Placement, residency and fusion kinds
