| Crates.io | runmat-ignition |
| lib.rs | runmat-ignition |
| version | 0.2.8 |
| created_at | 2025-10-15 04:40:36.88203+00 |
| updated_at | 2025-12-22 21:43:18.802168+00 |
| description | Baseline interpreter for RunMat enabling instant startup and execution |
| homepage | https://runmat.org |
| repository | https://github.com/runmat-org/runmat |
| max_upload_size | |
| id | 1883753 |
| size | 1,104,175 |
Ignition is RunMat's reference interpreter. It compiles the high-level IR (HIR) emitted by runmat-hir into a compact bytecode and executes it on a fast, non-allocating stack virtual machine. The design goal is full MATLAB grammar/semantic compatibility with clear, testable semantics and a codebase that is easy to extend.
Sibling docs for deep dives:
end arithmetic, N-D gather/scatter, expansionsubsref/subsasgn, operator overloadinginstr.rs: Instruction set enum Instr (bytecode opcodes)functions.rs: UserFunction, frames, and ExecutionContextcompiler.rs: exhaustive lowering for HirStmt/HirExprKindbytecode.rs: compile, compile_with_functionsvm.rs: Interpreter loop and semantics (execute)gc_roots.rs: RAII GC roots for stack/locals/globalscompile(&HirProgram) -> Bytecodecompile_with_functions(&HirProgram, &HashMap<String, UserFunction>) -> Bytecodeinterpret(&Bytecode) -> Result<Vec<Value>, String>interpret_with_vars(&Bytecode, &mut [Value]) -> Result<Vec<Value>, String>execute(&HirProgram) -> Result<Vec<Value>, String>Value. Locals are a separate array per frame. Both are GC roots.start[:step]:end).end; N-D gather via IndexSlice; 1-D/2-D fast-paths preserved.StoreSlice with broadcast/shape checks.EnterTry/PopTry; catch variable bound to Value::MException.nargin/nargout accounted; multi-assign via CallFunctionMulti.feval supported.subsref/subsasgn.CallFunctionMulti with explicit arity then sequential stores.IndexSlice. Stores mirror via StoreSlice.(I,scalar) → [|I|,1], (scalar,J) → [1,|J|]).end arithmetic per dimension; logical masks are validated and expanded to indices.mex(id, message) returns "<ID>: <message>".MATLAB:UndefinedFunction, MATLAB:UndefinedVariable, MATLAB:NotEnoughInputs, MATLAB:TooManyInputs, MATLAB:TooManyOutputs, MATLAB:VarargoutMismatch, MATLAB:SliceNonTensor, MATLAB:IndexOutOfBounds, MATLAB:CellIndexType, MATLAB:CellSubscriptOutOfBounds, MATLAB:ExpandError, MATLAB:MissingSubsref, MATLAB:MissingSubsasgn.LoadMember/StoreMember, LoadMethod/CallMethod with access checks.LoadStaticProperty/CallStaticMethod when base is a class reference.subsref/subsasgn. Missing hooks surface mex identifiers above.plus, mtimes), with numeric fallbacks normalized.A(:, j) and A(i, :) with strict shape checks and column-major writes.MATLAB:MissingSubsref/MATLAB:MissingSubsasgn only.runmat-runtime; wire special handling in the VM only if semantics require.IndexSlice/StoreSlice rather than scattering logic.