Show HN: Jax-JS, array library in JavaScript targeting WebGPU

JavaScript gets swole—ML in your browser sparks cheers and groans

TLDR: Jax-js puts machine learning in the browser using WebGPU and WebAssembly. Comments split: hype for a JS science boom vs gripes about manual memory cleanup and calls for benchmarks, plus questions about WebNN—big if true because it could make real ML run anywhere the web goes.

JavaScript just got a muscle upgrade: jax-js, a browser-based machine learning library inspired by JAX, compiles math into fast GPU code using WebGPU and WebAssembly (a super-fast web bytecode). Translation: your browser can suddenly do heavy-duty math without crying. The crowd reaction? Part hype, part headache.

The hype squad is loud: one user dreams this could “grow the JS science community,” while another says the project is so inspiring they’re porting tinygrad to Lean. The skeptics roll in just as fast. The spiciest thread: jax-js’s manual memory handling—you juggle .ref and .dispose()—which some say feels like Rust cosplay in JavaScript. Fans of TensorFlow.js (tfjs) point out they can auto-clean with tf.tidy, calling jax-js “low-level and error-prone.” Cue the popcorn.

Then come the numbers cops: “Show me benchmarks.” A commenter wants apples-to-apples against other autodiff tools and links gradbench, because without data, it’s just vibes. Standards watchdogs chime in too, asking where this sits next to WebNN, the W3C’s official web machine learning proposal.

Jokes flew: “JavaScript finally did leg day,” “my toaster’s doing calculus,” and “GPU gains in a tab.” Whether jax-js is the future or a glorious chaos experiment, the browser just got interesting.

Key Points

  • jax-js is a pure JavaScript machine learning library that runs entirely in the browser.
  • It compiles numerical programs into WebGPU and WebAssembly kernels for near-native performance.
  • The API mirrors JAX with features like grad, vmap, and jit, with some JS-specific syntax differences.
  • Memory management uses Rust-like move semantics and .ref due to JavaScript’s lack of destructors.
  • A runnable example trains a neural network on the MNIST dataset in-browser.

Hottest takes

“API in jax-js seems very low-level and error-prone” — mlajtos
“it would be awesome to see how the performance of jax-js compares” — sestep
“I hope this will help grow the js science community” — bobajeff
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.