A MATLAB-style numerical environment with a Rust M-file interpreter, matrices and mathematical functions.
MATLAB のオープンソース代替
A MATLAB-style numerical environment with a Rust M-file interpreter, matrices and mathematical functions. Provides a MATLAB-style desktop Studio, CLI, MCP/TCP automation, 2D/3D plotting with SVG/PNG/PDF export and MAT v5 load/save.
READMEGitHub の NibrasAz7/matcraft
MatCraft follows the conventions of the ArtCraft family of clean-room Rust apps. Come say hello, get help and follow development:
cargo run -p matcraft-cli -- repl # interactive session
cargo run -p matcraft-cli -- run examples/solve.m # run a script
cargo run -p matcraft-cli -- eval "A = [1 2; 3 4]; det(A)"
# ans = -2
cargo run -p matcraft-cli -- functions # the builtin library
cargo run -p matcraft-cli -- lsp # stdio language server
cargo run --release -p matcraft # the Studio (--control 7979 for TCP)
Real M-code: column-major matrices, cell arrays, structs, function files, end-indexing, grow-on-assign — the semantics you expect, not approximations.
A bytecode-compiled loop tier under the tree-walk interpreter, a feature-gated faer backend for matmul/SVD/eig, and complex eigendecomposition — while the default stays pure Rust and wasm-clean.
Every interface is headless-reachable: CLI, stdio LSP, newline JSON-RPC MCP, a TCP control channel, and the SimCraft engine bridge. No account, no telemetry, no cloud.
plot/loglog with styled lines · surf in the interactive wgpu viewport · imshow of a complex field · bar/histogram — all produced by the headless matplot pipeline.
surf, mesh and plot3 open in a real wgpu viewport — orbit, zoom and pan on the GPU, with colormap shading and axes.eig returns complex eigenpairs, A\b does least-squares, loadlibrary/calllib reaches plain-C libraries.matplot pipeline serves the Studio, the CLI (saveas → PNG/SVG/PDF) and SimCraft scopes.GNU Octave is the established free M-code environment — for sheer toolbox breadth it remains the larger codebase. MatCraft is a different bet, built for people who want the language inside something else.
faer backend and an opt-in gpu feature on wgpu — where Octave's interpreter loop is largely single-threaded.# comments, x += e) where public documentation allows.MatCraft is pre-alpha: Octave's maturity and coverage are far ahead today. If you need a complete, battle-tested M-code environment now, use Octave. If you want a Rust-native engine you can embed, automate and audit end to end, this is the one to watch.
Every surface reaches the same engine session — drive it from wherever you work.
| Interface | What it gives you |
|---|---|
matcraft Studio | egui + wgpu desktop app — ribbon, command window, workspace/figure docks, interactive 3-D viewport, live editor hints |
matcraft-cli | eval, run, repl, functions — script and shell use |
matcraft-cli lsp | stdio language server — parse diagnostics, builtin completion/hover, document symbols; point any editor at it |
| MCP server | newline-delimited JSON-RPC 2.0 on stdio — execute, eval, run_script, command listing, matcraft://workspace |
| Control channel | TCP JSON-lines when the Studio runs with --control — engine.execute, ui.state, ui.render, ui.screenshot |
| SimCraft bridge | sim.run, sim.check, model.set_param — block-diagram simulation inside your session, scopes land as matplot figures |
| Crate | Role |
|---|---|
crates/matcore | L0 — column-major f64/complex/sparse matrices, pure-Rust linalg, optional faer backend |
crates/matffi | L0 — loadlibrary/calllib/libpointer FFI into plain-C DLLs (the only unsafe boundary) |
crates/matlang | L1 — lexer, parser, interpreter (tree-walk + bytecode loop tier), builtins, signature metadata |
crates/matplot | L2 — figure model, headless SVG/PNG/PDF renderer, 3-D projection |
crates/engine | L5 — command/session layer; every user-visible behaviour is a command id |
crates/lsp | L6 — language-server protocol on stdio |
crates/jupyter | L6 — Jupyter kernel core (wire + semantics; ZMQ transport is a follow-up) |
crates/ui-egui | L6 — Studio UI: ribbon, docks, wgpu figure viewport, editor |
crates/mcp | L6 — MCP server |
apps/* | L7 — matcraft Studio, matcraft-cli, web shell |
cargo xtask layers enforces the stack — nothing below L6 touches egui/wgpu/winit.
ROADMAP.md is the one-page summary: headline numbers, progress log, the honest compatibility story. docs/gaps.md ranks the remaining work — Cranelift JIT for loop hotspots, the Jupyter ZMQ transport, broader plotting/toolbox coverage.
MatCraft is early and the work list is public. A good first move is one of the starter-sized issues drafted in plan/community-issues.md; open threads also live in the ranked gap list, docs/gaps.md, and the "further out" list in ROADMAP.md. Pull requests are welcome on GitHub.
Two house rules from AGENTS.md: everything stays clean-room — behaviour comes from public documentation and published papers, never a MATLAB install or copyleft code — and cargo xtask ci (fmt, clippy, tests, layers) is the gate before every commit.
MatCraft is built in the ArtCraft tradition — original, clean-room, Rust-native. Its numerical sibling is SimCraft: block-diagram simulation wired into this workspace.
MIT OR Apache-2.0. Every non-code file is original, open-licensed or generated by the project and is tracked in ASSETS.md. No proprietary code, artwork or data ships in this repository.
GitHub からの最終更新:4 時間前
GitHub の数値は1日に数回更新されます。
ログイン または アカウントを作成 するとコメントできます。
まだコメントはありません。最初のコメントを書いてみませんか。
アピールしましょう。順位と評価が載ったライブカードで、自動的に更新されます。
小さいほうがよければ、次を追加: ?style=flat