The Problem: Scientific Computing's Triple Bind
If you're a researcher, engineer, or student in any technical field, you've likely encountered this frustrating reality: MATLAB is the language you learned in school, but it's expensive, and the free alternatives are painfully slow.
This creates an impossible choice:
- Pay the toll: MATLAB licenses cost $2,150+ annually per user, with additional toolboxes costing thousands more. For students, universities, and open source projects, this is often prohibitive.
- Accept terrible performance: GNU Octave, the primary free alternative, is dramatically slower than MATLAB. Our benchmarks show 150-180x slower performance (versus RunMat) across typical workloads—a 5-second computation takes 15+ minutes in Octave. Your research crawls, simulations become unusable, and productivity plummets.
- Learn a new language: Python's NumPy/SciPy ecosystem is powerful, but it means abandoning the MATLAB syntax you already know and rewriting existing codebases. This is time-consuming and error-prone.
- Risk crashes and security issues: Traditional implementations in C/C++ are vulnerable to memory bugs, segfaults, and security vulnerabilities that can corrupt research data or compromise systems. We refuse to accept this trade-off. RunMat delivers high-performance execution of MATLAB code with the safety of modern systems programming and the accessibility of open source — often running MATLAB scripts faster than the original runtime while maintaining nearly perfect compatibility with the syntax you already know.
What Makes RunMat Different
🚀 V8-Inspired Performance Architecture
What is V8? V8 is Google's JavaScript engine that powers Chrome, Node.js, and most of the modern web. It's what makes JavaScript—once considered a "slow toy language"—fast enough to run complex applications like Google Docs, Discord, and VS Code. V8's secret? A sophisticated tiered execution system that we've adapted for numerical computing.
Why does this matter for scientific computing? Traditional MATLAB interpreters execute your code line-by-line, every single time. V8 proved there's a better way: start fast, then optimize the code that actually matters.
RunMat implements this proven approach with three components:
- Ignition Interpreter: Your code starts running instantly in our lightweight baseline interpreter. No compilation delays, no waiting—just immediate execution.
- Turbine JIT Compiler: As your code runs, our profiler identifies "hot" functions (loops that run thousands of times, frequently-called functions). These get compiled to optimized native machine code using Cranelift, achieving near-C performance.
- Intelligent Hotspot Detection: Not all code benefits from optimization. Our system learns which 20% of your code does 80% of the work and focuses optimization efforts there.
The result? Your scripts start immediately and automatically get faster as they run, without any action required from you. It's like having an expert systems programmer continuously optimizing your code in the background.
⚡ Zero Cold Start with Snapshotting
One of MATLAB's biggest pain points is slow startup time. RunMat eliminates this with revolutionary snapshotting:
- Instant startup: Pre-computed snapshots mean RunMat boots in under 50ms
- Workspace persistence: Your variables and functions survive between sessions
- Incremental compilation: Only changed code gets recompiled
- Cloud-ready: Snapshots enable serverless scientific computing
🛡️ Memory Safety Without Performance Cost
Built in Rust, RunMat eliminates entire classes of bugs that plague traditional scientific software:
- No segfaults: Rust's ownership system prevents memory access violations
- No data races: Thread safety is guaranteed at compile time
- No buffer overflows: Array bounds are checked without performance overhead
- Predictable performance: Our garbage collector uses generational collection optimized for numerical workloads
🎨 Beautiful, GPU-Accelerated Plotting
RunMat's plotting system is built from the ground up for modern hardware:
- GPU acceleration: All rendering happens on the GPU via WebGL/Metal/Vulkan
- Interactive by default: Zoom, pan, and rotate with 60fps performance
- Multiple backends: Export to PNG, SVG, PDF, or interactive web widgets
- Modern aesthetics: Beautiful themes that make your data shine
- MATLAB compatibility: Familiar plotting syntax that just works
Performance That Speaks for Itself
Our comprehensive benchmarks demonstrate RunMat's dramatic performance advantages over GNU Octave. These results were obtained on an Apple M2 Max with 32GB RAM running both systems under identical conditions:
🚀 Startup Performance: 182x Faster
- GNU Octave: 914ms average startup time
- RunMat: 5ms average startup time
- Speedup: 182.93x faster cold start performance
⚡ Matrix Operations: 164x Faster
Testing matrix addition, multiplication, transpose, and scalar operations on matrices up to 500×500:
- GNU Octave: 822ms average execution
- RunMat: 5ms average execution
- Speedup: 164.40x faster matrix computations
🧮 Mathematical Functions: 153-163x Faster
Trigonometric, exponential, and statistical functions on arrays up to 500,000 elements:
- GNU Octave: 868ms average execution
- RunMat Interpreter: 5.7ms average (153.13x faster)
- RunMat JIT: 5.3ms average (162.69x faster)
🔄 Control Flow: 154x Faster
Loops, conditionals, and function calls with up to 10,000 iterations:
- GNU Octave: 876ms average execution
- RunMat: 5.7ms average execution
- Speedup: 154.54x faster control flow execution
Key Performance Insights:
- Consistent speedups: 150-180x faster across all workload types
- JIT benefits: Additional 6-13% performance boost for mathematical functions
- Sub-5ms startup: Revolutionary snapshotting eliminates MATLAB's notorious cold start delays
- Memory safety: Zero crashes or memory leaks in extensive testing
- BLAS/LAPACK integration: Leverages optimized linear algebra libraries
Full benchmark suite available in /benchmarks
. Run ./benchmarks/run_benchmarks.sh
to reproduce these results on your system.
Goal: Near-Perfect MATLAB Compatibility
Our goal is 99.99% compatibility with existing MATLAB code. This isn't just about supporting the "common subset"—we're building a high-performance runtime that handles the edge cases, quirks, and advanced features that real MATLAB codebases depend on.
Currently supported (and growing daily):
- All matrix operations: Creation, indexing, slicing, broadcasting, linear algebra
- Complete control flow: if/elseif/else, for loops, while loops, break/continue, nested structures
- Function system: Function definitions, calling, overloading, anonymous functions, closures
- Mathematical functions: 50+ built-in functions including trigonometric, statistical, and special functions (rapidly expanding)
- Advanced plotting: 2D/3D plotting, multiple plot types, customization, interactive features
- Data I/O: File reading/writing, CSV, binary formats, workspace management
- Variable management: Workspaces, scoping, global variables, persistent variables
- Array operations: Element-wise operations (.*, ./, .^), concatenation, reshaping
Migration is effortless: In most cases, you can literally copy-paste your existing MATLAB code into RunMat and it will run faster than before. No rewriting, no porting, no learning new syntax.
How RunMat Works
RunMat's architecture is designed for both simplicity and performance, inspired by modern JavaScript engines like V8:
🔄 Execution Pipeline
Your MATLAB code flows through a carefully optimized pipeline:
-
Parsing & Analysis: RunMat's lexer and parser break down your MATLAB syntax into an optimized internal representation, handling all the edge cases and quirks that make MATLAB unique.
-
Smart Compilation: The system generates efficient bytecode that can run immediately in our interpreter (Ignition) while identifying opportunities for optimization.
-
Adaptive Optimization: Hot code paths are automatically compiled to native machine code using our JIT compiler (Turbine), delivering near-C performance where it matters most.
🧠 Core Components
- Ignition Interpreter: Provides instant startup and reliable execution for all MATLAB constructs
- Turbine JIT: Compiles frequently-used code to optimized native instructions
- Runtime System: Implements MATLAB's built-in functions with high-performance BLAS/LAPACK integration
- Memory Manager: Generational garbage collector optimized for numerical computing workloads
- Snapshot System: Enables instant startup and workspace persistence across sessions
🎯 User Interfaces
- REPL: Interactive command-line interface for exploratory computing
- Jupyter Integration: Full notebook support for data science workflows
- Plotting Engine: GPU-accelerated visualization with familiar MATLAB syntax
This modular design means RunMat can serve everything from quick interactive calculations to long-running scientific simulations, all while maintaining the MATLAB syntax and semantics you already know.
Open Source by Design
RunMat is completely open source under the MIT license (with attribution requirements). This ensures:
- Free forever: No licensing fees, no usage restrictions for most users
- Community-driven: Development happens in the open with community input
- Extensible: Add your own functions and features
- Transparent: No black boxes, no vendor lock-in
- Educational: Perfect for teaching and learning
Get Started Today
Install RunMat in seconds
# Linux/macOS
curl -fsSL https://runmat.org/install.sh | sh
# Windows
iwr https://runmat.org/install.ps1 | iex
Run your first script and see the 150x speedup
echo "plot(sin(0:0.1:2*pi))" | runmat
That's it! For alternative installation methods (package managers, Cargo, direct downloads), visit our download page.
Why This Matters
The performance improvements have practical implications for real workflows:
- Faster iteration cycles: What takes 15 minutes in Octave runs in 5 seconds, enabling rapid prototyping
- Truly interactive development: Sub-5ms startup enables real-time exploratory computing
- Significant cost savings: Avoid MATLAB's $2,150+ annual per-user licensing while often achieving superior performance for MATLAB code execution
- Reduced infrastructure costs: Computations that needed clusters can run on laptops
- Memory safety: Rust's ownership model prevents entire classes of bugs that corrupt research data
What's Next
RunMat represents just the beginning. We're building a complete ecosystem for scientific computing:
- Full built-in coverage: Our roadmap targets implementing the entire MATLAB built-in function set with high-quality, well-tested equivalents.
- Major toolboxes: Signal Processing, Statistics & Machine Learning, Image Processing, Optimization, Control Systems, and more. These APIs are well understood, and we're using LLM-assisted tooling to accelerate development while keeping rigorous tests and benchmarks to ensure correctness and performance.
- High-performance graphics: Our wgpu-based graphics engine is designed for extremely dense visualizations—think multi-million-point scatter/point clouds, large mesh rendering, and complex interactive scenes—while staying responsive and visually crisp.
- Extensibility first: RunMat is an open, modular runtime. Add functions, contribute toolboxes, build custom accelerators, and integrate with your pipelines.
Were actively seeking contributors. If you'd like to help implement built-ins, toolboxes, plotting primitives, or docs, head over to our GitHub repository and jump in: https://github.com/runmat-org/runmat
Spread the word and share RunMat with your friends and colleagues. Scientific computing deserves better tools, and together we can make high-performance, accessible computing the new standard for researchers, engineers, and students worldwide.
RunMat is developed by Dystr - a next generation computational platform for engineering teams. Learn more at dystr.com.