# chenglou/handwired

> Handwired is a TypeScript project that turns ordinary JavaScript numeric code into a neural net made of matrix multiplication and ReLU, without any training step. It is for developers who want programs like if-else branches, loops and state to stay exact and fully differentiable. Its core idea is to rewrite those constructs as basic arithmetic built from addition, multiplication and ReLU, then collect them into one large matrix multiplication that runs on JavaScript or WebGPU.

Source: https://github.com/chenglou/handwired
Indexed: commit 4ea7fcb on 2026-10-16 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: App
- Language: TypeScript
- Stars: 2,160 at index time
- License: MIT
- Code health: 7.1/10, Good
- Last commit: 2026-10-15
- Contributors: 1

## How it works

Input enters as ordinary JavaScript arithmetic, and the src directory provides the shared plumbing for building typed numeric circuits and compiling them into GPU-ready programs. The template/main.ts file is a runnable entry point that wires a generic toggle simulation into a single surface, showing how a program runs end to end. The lab/json-search/million/run.ts file is one of the entry points for the JSON search demo, which runs a program over a large document set. The scripts directory builds, validates and serves the demo site pages, and assets/index.html is one of the central pages that the site is built around. The README.md file explains the approach and the two primitives, addition and multiplication plus ReLU, that the generated program uses.

- lab/json-search/million/run.ts: entry point
- lab/knuth-plass/gpu/run.ts: entry point
- lab/ui-exploration/input/app.ts: entry point
- lab/ui-exploration/text-walker/batch/gpu/run.ts: entry point
- template/main.ts: entry point
Modules: lab, tests, src, scripts, template, root. 955 files, 155,605 lines, 9,173 symbols.

## Code health

- Score: 7.1/10 (Good)
- Rank: #135 of 4,000+ indexed repos
- Hotspots: src/handwiredos/window-manager.ts, src/handwiredos/photo-gallery.ts, src/runtime/numeric-ui-core.ts, src/learned-gallery/learned-gallery.ts, src/json-search/demo.ts
- Lowest file: src/runtime/numeric-ui-core.ts
- Dead code: 64 findings

## Maintenance

- Last commit 2026-10-15, first commit 2026-06-04, 547 commits
- 1 contributors, bus factor 1

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/chenglou/handwired/security

## More

- Page: https://repowise.dev/repo/chenglou/handwired
- Ask this codebase: https://repowise.dev/repo/chenglou/handwired/chat
- Docs: https://repowise.dev/repo/chenglou/handwired/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/chenglou/handwired
