Choosing a target
There is no universally “best” target — the right destination depends on the shape of the pressure you are feeling. Use the matrix below to map a signal to an ecosystem, then open the matching playbook.
Target-selection matrix
| Pressure / need | Recommended target | Notes |
|---|---|---|
General N-D numeric arrays, dense matmul, axis reductions at scale | ndarray | The general Rust N-D array production path; BLAS-backed matmul available. |
| Small/mid dense vectors & matrices, decompositions, solvers (LU/QR/SVD), eigenvalues | nalgebra | The dense linear-algebra path. |
| Group-by, joins, pivots, query-style dataframe analytics | Polars (Rust) / Pandas (Python) | matten-data is an ingestion on-ramp only; it will not grow these. |
| Autodiff, training loops, GPU/device execution | Candle (Rust) / framework of choice | matten is not an ML framework. |
| Existing Python scientific stack, NumPy interop | NumPy (Python) | Manual/conceptual hand-off; no automatic bridge. |
| Small numeric work, ingestion, glue, learning/PoC | stay with matten | Migrating here would add dependencies for no real gain. |
A quick decision path
- Is the bottleneck a dense numeric kernel (matmul, matrix–vector, operator
application, axis reductions) that you have measured as hot? →
ndarray(general N-D) ornalgebra(if it is fundamentally small/mid dense linear algebra needing decompositions). - Do you need linear-algebra results
mattendoes not provide (LU/QR/SVD, solvers, eigenvalues)? →nalgebra. - Is the real need tabular (group-by/join/pivot/query)? → Polars (Rust) or Pandas
(Python). Not
matten-data. - Is it ML (autodiff/training/GPU)? → Candle or another ML framework.
- Are you already in Python? → NumPy/Pandas, with
mattenas the upstream Rust producer if useful. - None of the above, or the work is small? → stay with
matten.
Playbooks
Full per-target playbooks are available for every destination above:
ndarray, nalgebra,
Polars/Pandas, Candle, and
NumPy. The two Rust array/linalg targets carry task-scoped
positioning notes from the accepted RFC-049 peer comparison; the dataframe, ML, and
Python targets are different paradigms with no such benchmark (see each playbook).