matten
A family car of Rust array (tensor) library — easy to start, predictable, and friendly for quick numerical trials / PoCs.
Overview
matten is a developer-experience-first multidimensional array (tensor) library
for Rust. It makes early-stage numerical and data-exploration work feel close to
NumPy/Pandas ergonomics while staying native Rust: one concrete Tensor type, no
visible lifetimes, no generic dtype puzzles, and human-readable failures.
It deliberately favors developer experience over peak performance, and is not
a replacement for ndarray, nalgebra, or candle on hot paths.
Why / when to use it
Reach for matten when you want to prototype quickly: represent vectors,
matrices, and tensors, do simple shape work and arithmetic, and move messy
JSON/CSV in and out — without wrestling with views, lifetimes, or trait bounds.
When a prototype becomes performance-critical, matten is designed to hand its
flat data off to a specialized crate.
Status: active pre-1.0 development. Phase 1 numeric core is strong; The
dynamicfeature supports heterogeneous ingestion (from_json_dynamic,from_csv_dynamic), missing-value cleanup (fill_none,none_mask,forward_fill_none), and explicit conversion to numeric tensors (try_numeric). Dynamic reshape, slicing, arithmetic, reductions, and serde are intentionally guarded — calltry_numeric()first. Dynamic is a guarded heterogeneous-ingestion and cleanup feature, not a full dynamic tensor arithmetic engine. RFC-000 through RFC-021 are inrfcs/done/. v1.0.0 requires explicit maintainer confirmation. See CHANGELOG.md and docs.rs for details. The full mdBook lives indocs/in the repository (not included in the crate package).
Quick start
use Tensor;
let a = new;
assert_eq!;
assert_eq!;
// Boundary-style construction is recoverable instead of panicking:
use MattenError;
let bad = try_new;
assert!;
Lean install (smallest dependency footprint):
= { = "0.15", = false }
Design notes
- One primary type. Users work through
matten::Tensor. The public root also exposesMattenErrorandDataFormat; the dynamicElementengine is a Phase 2, feature-gated addition. - Two error zones. Local convenience APIs panic with actionable messages for
fast PoC feedback; every external boundary returns
Result<_, MattenError>and never panics on ordinary invalid input.MattenErrorderives onlyDebug, so match it by variant, not==. - Convenient by default, lean on request.
default = ["serde", "json", "csv"]for a smooth first run;default-features = falsefor the lean core. - Safe Rust only. The crate is
#![forbid(unsafe_code)].
More detail
- Full documentation: docs.rs (API reference) and the
docs/mdBook in the repository. - Design and governance: the
rfcs/pack and roadmap in the repository. - License: Apache-2.0 (see
LICENSEandNOTICE).