Docs/Overview
Who This Is For
FrankenNumPy is not trying to replace NumPy for every workload tomorrow. It targets a specific audience:
| Audience | Why FrankenNumPy is useful |
|---|---|
Rust applications that want numerical arrays without taking on unsafe C dependencies, calling out to BLAS, or shelling to Python. The 10 numeric-core crates have zero hand-written unsafe blocks (fnp-python, the PyO3 layer, is the exception: 67 audited unsafe blocks/items encapsulating borrowed-buffer views, unchecked indexing, transmute, and target-feature kernels) and zero external runtime C dependencies in those 10 crates (fnp-python calls glibc libm directly and needs NumPy at run time). |
|
| Reproducibility-critical pipelines (regulatory ML, scientific publication, financial backtesting) that need bit-exact RNG and dtype-deterministic promotion across machines and across NumPy versions. PCG64DXSM streams are bit-exact vs upstream NumPy; the 324-pair promotion table is exhaustively explicit. | |
Security-conscious systems that read untrusted .npy / .npz from third parties. NumPy's C parsers are an attack surface; the fnp-io parsers are bounded, fail-closed, and fuzzed. From Python, fnp_python.load decodes a plain .npy path through fnp-io but hands file-like objects and every .npz to numpy.load in strict mode; in hardened mode every load source is checked against the fnp-io bounds first and refused with ValueError on a violation (ledger row DIV-HARDENED-LOAD-BOUNDS). |
|
| Embedded / kiosk-style Rust deployments that want NumPy-shaped APIs without dragging a Python interpreter into the build. | |
Library authors writing differential-test oracles against their own numerical code. The fnp-conformance crate is a reusable oracle harness; it captures NumPy reference output and compares against any implementation, not just FrankenNumPy. |
|
| Researchers studying NumPy semantics. Every shape transformation, dtype promotion, and ufunc dispatch decision is implemented as a small, readable, fully tested Rust function. The codebase is a legible specification of NumPy's actual behavior. | |
NumPy users who want a drop-in Python module with native-speed hot paths and numpy fallback everywhere else. (Caveat: no PyPI release yet; pip install . builds the wheel locally. See Installation.) |
This is the wrong tool if your bottleneck is large dense matmul on >2,000×2,000 matrices with OpenBLAS already linked, or if you need GPU acceleration today. Those gaps are documented in Limitations and tracked in the Roadmap.