Trait-oriented linear algebra foundations for MoonBit, with checked APIs, backend wrappers, and mutable/immutable dense matrix and vector types.
Dependencies
moon add Luna-Flow/linear-algebra@0.4.2
moon add Luna-Flow/luna-generic@0.3.3
moon add Luna-Flow/arithmetic@0.2.2import {
"Luna-Flow/linear-algebra/algebra",
"Luna-Flow/linear-algebra/arithmetic" @la_arithmetic,
"Luna-Flow/luna-generic" @lf_alg,
"Luna-Flow/arithmetic" @lf_arith,
}///|
test "linear-algebra basic workflow" {
let imm = @immut.Matrix::from_2d_array([[1, 2], [3, 4]])
let imm_updated = imm.set(0, 1, 9)
inspect(imm_updated, content="|1, 9|\n|3, 4|")
let m = @mutable.Matrix::from_2d_array([[1.0, 2.0], [3.0, 4.0]])
m.set(0, 1, 9.0)
inspect(m.determinant().unwrap(), content="-23")
inspect(m.inverse() is Ok(_), content="true")
inspect(m.row_view(0)[1], content="9")
}| Version | Date | Status | Notes |
|---|---|---|---|
| 0.4.2 | 2026-07-09 | current repository release | Added packed mutable matmul kernels for larger products and automatic benchmark fixture recovery for clean checkouts |
| 0.4.1 | 2026-07-07 | previous release baseline | Refined benchmark measurement, added public unchecked mutable matmul, optimized mutable hot loops, and simplified publishing |
| 0.4.0 | 2026-07-07 | previous release baseline | Introduced checked matrix APIs, structured linear-algebra errors, layered capability packages, and default backend wrappers |
| 0.3.0 | 2026-06-14 | published on mooncakes | Adopted shared arithmetic.Sqrt, current luna-generic homomorphisms, and ecosystem-wide numeric capability identities |
| 0.2.12 | 2026-06-06 | published on mooncakes | Strict bounds unification, semantic correctness fixes, benchmark diagnostics expansion, and documentation/audit refresh |
| 0.2.11 | 2026-05-27 | previous release baseline | Performance-tuned mutable kernels, dedicated wasm-gc backend, benchmark/reporting expansion, and API/doc alignment |
| 0.2.10 | 2026-05-27 | previous release baseline | Unified flattened mutable storage, matrix views, consistency coverage, benchmark coverage, and release-process alignment |
| 0.2.9 | 2026-02-03 | published on mooncakes | Published from the earlier 3328195 release state |
| 0.2.8 | 2026-02-03 | historical baseline | Algorithms and stability milestone used as the comparison baseline for later work |
moon fmt
moon info
moon check
moon test -p perf_support
moon test -p perf_runner
moon test --enable-coverage
./run_test.sh
LINEAR_ALGEBRA_TEST_BENCH=1 ./run_test.sh# This repository is primarily a library, so use an explicit package target.
moon run src/perf_runner mul_baseline_dense_64
# Optional: materialize benchmark fixtures ahead of time.
python3 bench/generate_fixtures.py
# Full benchmark flow.
just benchTrait-oriented linear algebra foundations for MoonBit, with checked APIs, backend wrappers, and mutable/immutable dense matrix and vector types.
Dependencies