{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreigsexfosv2m5hf4a7nmfuuumdvlzztbxvuyznk6dtmfv5aubfm6mu",
"uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mpfewkalnqh2"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreihinueclst5jxdfedltbvkmas5xnxuccaihbqydtsxvniaummtf5m"
},
"mimeType": "image/webp",
"size": 57920
},
"path": "/nabbisen/matten-introduction-a-family-car-tensor-library-for-rust-52ak",
"publishedAt": "2026-06-29T01:45:50.000Z",
"site": "https://dev.to",
"tags": [
"math",
"tensor",
"matrix",
"rust",
"matten",
"ndarray",
"nalgebra",
"crates.io",
"docs.rs",
"mdBook",
"repository"
],
"textContent": "I recently published matten, a small Rust library for working with multidimensional arrays. This is the first of four short posts introducing it. This one is about why it exists.\n\nRust is a great language for numerical and data-oriented work. But starting that work — just getting to the point where you have a matrix and can add two of them together — takes more effort than it probably should at the prototype stage.\n\nThe established libraries are capable and well-maintained. If you need performance, reach for ndarray or nalgebra. They are the right tools for production numerical code.\nBut they come with a learning curve: generic type parameters, storage abstractions, view types, lifetime considerations. That overhead is often worth it. It is not always worth it on day one of a proof of concept.\n\nThe gap `matten` fills is narrow and deliberate: **making early-stage numerical Rust work feel less ceremonial** , so you can spend the first hour on the problem rather than on the type system.\n\nThe project description borrows a modest analogy: a family car. Easy to get into, predictable to drive, comfortable enough for most everyday trips. Not a racing car. Not trying to be one.\n\nConcretely that means:\n\n * One primary public type, `Tensor`, with no generic parameters.\n * No user-visible lifetimes in ordinary usage.\n * Human-readable error messages when shapes do not match.\n * JSON and CSV support on by default, for moving data in and out without ceremony.\n * `#![forbid(unsafe_code)]` throughout.\n\n\n\nWhat it does not mean: faster than the alternatives on hot paths. The library is explicit about this. When a prototype grows into something performance-critical, the right move is to migrate that part of the work to a more capable library. `matten-ndarray` exists specifically for that handoff, and the flat `Vec<f64>` storage makes the data easy to move.\n\nIf that sounds like the right tool for a project you have in mind, the next post covers what the core library actually looks like in practice.\n\nP.S. — The name is from **mat** hematical **ten** sor NOT 😜 It's from a Japanese charming dialect meaning \"waited for\". We took our time, and so can you.\n\n**Links:** crates.io · docs.rs · mdBook · repository",
"title": "matten Introduction: A family-car tensor library for Rust"
}