Settings

Theme

Show HN: NumPy for Browser, Node.js, Deno and Bun

github.com

2 points by dupontcyborg 3 months ago · 0 comments · 1 min read

Reader

I've been spending some time on a side project, `numpy-ts`, which is a TypeScript numerical library inspired by NumPy. It aims to bring the same NumPy API (where possible) to Node.js/Browser/Deno/Bun with full .npy/.npz compatibility (read & write).

It currently has 476 of NumPy's 507 functions implemented, all cross-validated against NumPy with >6,000 validation tests. The lib is about 93 kB minified+gzipped and has zero dependencies, and it's fully tree-shakeable.

Since it's written in TypeScript, it's on average 15x slower than NumPy. I just tagged 1.0.0, and will begin performance optimization soon (both algorithmic and selective WASM for fused kernels).

You can try it in your browser here: https://numpyts.dev/playground

Disclaimer that this was a mix of hand-written code (API, deterministic tooling) and AI-assisted (functional implementations, validation test implementations).

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection