RunMat – a V8 inspired Rust runtime for the landlocked Matlab language
RunMat – a V8 inspired Rust runtime for the landlocked Matlab language
Why build this? MATLAB wasn’t chosen by engineers; it was inherited from classrooms. That unfair advantage let MathWorks sell a decades-old runtime with heavy startup, sluggish hot loops, and paywalled toolboxes. It milks about $500M a year out of the engineering ecosystem for what amounts to an outdated compiler and runtime stack. GNU Octave has been the main open-source way to run MATLAB code but it only supports a subset of the grammar and semantics, and its performance is far behind modern expectations. It’s more of a compatibility bridge than a true runtime alternative. I decided to implement a MATLAB language compiler and executor from scratch, grammar and semantics complete, in Rust with a modern architecture inspired by V8. Like V8, RunMat starts in a lightweight interpreter, then profiles and JITs hot paths using Cranelift. Snapshotting makes cold start essentially vanish (5ms vs 2–10s in MATLAB), and tensor operations run natively across CPUs or GPUs (CUDA, Metal, Vulkan) without an extra license. Performance (vs Octave, Apple M2 Max, 32GB): * Startup: 0.9147s → 0.005s (180× faster) * Matrix ops: 0.8220s → 0.005s (164×) * Math funcs: 0.8677s → 0.0053s (160×) * Control flow: 0.8757s → 0.0057s (154×) Unlike Octave, RunMat implements the full MATLAB grammar: arrays/indexing (end/colon/masks/N-D), multiple returns, varargin/varargout, classdef OOP, events/handles, metaclass, and standardized exceptions. The core is slim at 5MB static binaries for Linux, macOS, and Windows (or embedded devices and containers), with language extensibility coming from packages that can be written in MATLAB or in Rust. It’s 100% open source: The repo is about 3M characters of code, has over 1,000 tests covering the edges of the semantic surface, and was bootstrapped in three weeks. A package manager is next, along with a final draft of the builtin standard library. TLDR: Same language semantics, but rebuilt with modern methods, the way Chrome’s V8 redefined JavaScript engines.
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Railcar – a container runtime in rust
Youki – A Container Runtime in Rust
Implementing an Async Runtime in Rust
Asupersync, the Cancel-Correct Async Runtime for Rust
EC2 Management in Rust (Htop Inspired)
Polly: A templating language for Rust
Emu – Language for Gpgpu from Rust
Emu – Language for Gpgpu Scripting from Rust
Rust implementation of µKanren, a featherweight relational language
Fastimer, runtime-agnostic timer traits and utils for Async Rust