handwired

Handwired turns ordinary JavaScript logic into differentiable neural-network-style calculations, so programs can run as matrix operations in JavaScript or WebGPU. It is for experimenting with GPU execution and optimization of code written in a traditional style.

Share on XLicense: MIT

Overview

Handwired is a TypeScript project that converts ordinary JavaScript control flow into arithmetic built from addition, multiplication, and ReLU. It expresses branches as calculations, then combines the operations into matrix multiplication. The resulting program remains differentiable and can run in JavaScript or WebGPU. The project is for exploring GPU execution and optimization of code written in a traditional style, with demos including JSON search across 100,000 documents.

Key features

  • Express conditional branches using arithmetic and ReLU.
  • Combine additions, multiplications, and ReLU into matrix multiplication.
  • Run the calculations in JavaScript or WebGPU.
  • Includes a JSON search demo over 100,000 documents.

Best for

Developers curious about differentiable programs or GPU execution of traditional JavaScript can use Handwired to explore these ideas through its demos and code.

Upstream
chenglou/handwired
Fork on GitHub
Guo-astro/handwired
Upstream stars
1.6k
Category
Developer tools and infrastructure
Language
TypeScript
License
MIT
Forked
2026-10-16
Sync status
In syncLast synced 2026-10-18