numpy-ts is to be the best possible NumPy implementation for JavaScript and TypeScript. To get there, there’s have a long list of features, optimizations, and API improvements to build. Here’s a high-level roadmap of what’s coming next:
Async / Worker offloading
Heavy operations likematmul, svd, fft, and convolve can block the main thread for tens of milliseconds on large inputs. We’re designing an opt-in np.async.* namespace that transparently offloads these to a Web Worker pool:
- SharedArrayBuffer (zero-copy) when COOP/COEP headers are present
- postMessage (universal fallback) for environments without cross-origin isolation
Multi-threaded WASM
Extend the WASM acceleration layer to use multiple threads viaWebAssembly.Memory with shared: true and Web Workers. This would allow large matrix operations to be parallelized across CPU cores without leaving the WASM execution context.
Ufunc framework
A generalized ufunc (universal function) system that would allow users to define custom element-wise and reduction operations that automatically get broadcasting, dtype promotion, and axis handling:Masked arrays
Support for arrays with a boolean mask that marks invalid or missing entries. Operations would automatically skip masked elements, similar to NumPy’snumpy.ma module:
Structured arrays / record arrays
Arrays with named, heterogeneous fields — useful for tabular data without pulling in a full DataFrame library:Random distribution parity
While numpy-ts implements all core random distributions, some NumPy random functions have subtle parameter variations and edge-case behaviors that differ. The goal is full behavioral parity with NumPy’snumpy.random.Generator interface.
This roadmap reflects current thinking, not commitments. Items may be reprioritized, combined, or dropped based on what the community actually needs. The best way to influence the roadmap is to open an issue with your use case.