ndarray
An n-dimensional array library for Rust with array views, slicing, and BLAS-backed numerics
Repository Health
Technical Analysis
ndarray brings NumPy-style n-dimensional arrays to Rust: a generic ArrayBase type supporting owned, shared, and view-based storage, multidimensional slicing and broadcasting, element-wise and linear-algebra operations, and optional BLAS/rayon backends for high-performance numerics. It is the foundation numerical and scientific-computing crates in the Rust ecosystem build on when they need array-shaped data with NumPy-like ergonomics rather than plain Vecs or nested arrays.
What You Get
- A generic
ArrayBasetype parameterized over storage (owned, shared, view) and dimensionality (1D through N-D, fixed or dynamic) - NumPy-style slicing, broadcasting, and axis operations via the
s![]macro andAxisAPI - Element-wise arithmetic operator overloads and reduction/aggregation methods (sum, mean, fold, etc.)
- Optional BLAS backend integration (via the
blasfeature andcblas-sys) for accelerated matrix multiplication - Optional Rayon integration for data-parallel iteration over array elements and axes
Common Use Cases
- Implementing numerical algorithms (linear algebra, signal processing, simulations) that need n-dimensional array manipulation in Rust
- Building machine-learning or scientific-computing crates that require NumPy-like array semantics without a Python dependency
- Working with zero-copy array views over externally-owned buffers (e.g. memory-mapped data or FFI buffers)
- Parallelizing array computations across cores via the optional Rayon integration
Under The Hood
Architecture - The crate centers on ArrayBase<S, D>, generic over a storage trait S (owned Vec-backed, Rc-shared, or borrowed view) and a dimension type D, with dozens of impl_*.rs modules (impl_1d, impl_2d, impl_dyn, impl_raw_views, impl_cow, etc.) implementing dimension- and storage-specific behavior against that one shared type, so the same array API works uniformly whether the data is owned, shared, or borrowed. Tech Stack - Pure Rust (edition 2021, Rust 1.87+), depending on num-traits/num-complex/num-integer for numeric abstractions and matrixmultiply for pure-Rust matrix multiplication by default, with optional rayon for parallelism and cblas-sys/libc behind a blas feature flag for calling out to an external BLAS implementation; it’s structured as a Cargo workspace with a companion ndarray-rand crate. Code Quality - The tests/ directory has dedicated suites per concern (array-construct, assign, azip, broadcast, complex, dimension, format), benches/ cover performance-sensitive paths, and proptest-regressions/ captures property-test-discovered regressions, reflecting a codebase that takes numeric-correctness edge cases seriously. API Design - The API deliberately mirrors NumPy’s mental model (axes, broadcasting, slicing macros) to lower the switching cost for developers coming from Python’s scientific stack, though the type-level encoding of storage and dimensionality means generic code over arrays can require verbose trait bounds compared to NumPy’s dynamically-typed arrays.
Used by 9 apps in this directory
Anarlog
Note Taking · AI Assistants · Productivity
Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.
Cap
Team Chat · Video Conferencing
Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.
Continue
Developer Tools · AI Development · AI Code Assistants
Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.
Laminar
AI Development · Monitoring
Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.
magika
Developer Tools · Security
AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.
Meetily
Productivity · AI Assistants
Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.
PostgresML
Databases · AI Development
Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.
Qdrant
Databases · AI Development · Search
Open-source vector database and search engine built in Rust for production-grade AI applications — from semantic search to RAG pipelines and recommendation systems.
Trieve
AI Development · Search · Developer Tools
All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.