2 pointsby dupontcyborg4 hours ago1 comment
  • dupontcyborg4 hours ago
    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

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