ndarr is an experimental JavaScript library for numerical computing with N-dimensional arrays, inspired by NumPy.
The goal is to provide an intuitive API for matrix and array operations using TypedArray
, enabling high-performance computing in JavaScript environments.
This project is currently in early development. Contributions, ideas, and discussions are welcome!
Stage: Initial design and prototyping
Main focus: Internal architecture,np.array()
constructor, shape/dtype inference.
- [ ]
np.array(data)
— construct arrays from nested JS arrays - [ ]
np.zeros(shape)
— create zero-filled arrays - [ ]
np.ones(shape)
— create one-filled arrays - [ ]
NDArray.prototype.get(...indices)
— access values - [ ]
NDArray.prototype.set(...indices, value)
— assign values - [ ]
NDArray.prototype.reshape(newShape)
— reshape arrays - [ ]
NDArray.prototype.transpose()
— transpose dimensions - [ ]
np.dot(a, b)
— matrix multiplication - [ ] Basic operations:
add
,sub
,mul
,div
- [ ] Statistical ops:
mean
,sum
,argmax
,std
- [ ] Broadcasting support
- [ ] Slice/indexing:
a[0:2, 1]
- [ ] Dtype support:
float64
,float32
,int32
,uint8
, ...
JavaScript lacks a native high-performance numerical array system comparable to NumPy. This library explores how far we can go using native ArrayBuffer
and TypedArray
to support numerical operations, linear algebra, and eventually integration with ML/web systems.
npm install ndarr
MIT © Oleh Levchenko @leva13007