repowiserepowise

App

chenglou / handwired

Turn your regular JavaScript code into a neural net.

★ 2,160stars on GitHubTypeScriptMIT

Claude Code, Cursor, Codex or VS Code. No key. You approve one sign-in in your browser.

Repowise maps public repos from their source. Not affiliated with chenglou. What is Repowise?

github.com/chenglou/handwiredIndexed at 4ea7fcb

What is 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. Its code health is 7.1 out of 10 (Good), ranked #135 of 4,000+ indexed repos. The last commit to handwired was on Oct 15, 2026, and 1 person has contributed.

As of commit 4ea7fcb, indexed Oct 16, 2026. What it is comes from a model reading the README; the rest is measured from the source and git history, not from the maintainer.

For agentshandwired.md

Repo facts: type, license, health, rank, contributors
handwired facts
TypeApp
LicenseMIT
Code health7.1 / 10 (Good)
Health rank#135 of 4,000+ indexed repos
Last commitOct 15, 2026
Contributors1
Bus factor1
Size955 files, 155,605 lines

Explore handwired

Ask about this code in your agent

This connects Repowise to handwired's code. It does not install handwired.

Useful if you want to change or fork handwired: your agent can ask how it is put together and get answers that cite its files.

Ask about handwired

Answers come from handwired's README and source, with the files they cite. Two free answers a day without an account.

Featured answer

Handwired is a TypeScript project from chenglou/handwired that turns ordinary JavaScript numeric code into a neural net made of matrix multiplication and ReLU, with no training step. It is aimed at developers who want programs with if-else branches, loops and state to stay exact and fully differentiable, by rewriting those constructs as addition, multiplication and ReLU and collecting them into one large matrix multiplication that runs on JavaScript or WebGPU. The Application layer, which holds 645 of the 955 files, centers on the src directory, which supplies the shared plumbing for building typed numeric circuits and compiling them into GPU-ready programs. The Types and Config layers are each a single file, while Docs & Tooling holds 134 files, including the scripts directory that builds, validates and serves the demo site pages, and assets/index.html. To start reading, open README.md for the approach and its primitives, then template/main.ts for a runnable end-to-end example, and lab/json-search/million/run.ts for the JSON search demo.

Files per layer in handwired4 layers.

Basis: Inferred · knowledge graph· as of 4ea7fcb

Want this for your own codebase? Map your repo free

About this page

Get a page like this for your own codebase

Repowise built this map of chenglou/handwired from its source and git history. It parses every symbol, draws the dependency graph, scores each file's health from complexity, duplication, coverage and churn, finds hotspots and owners in the history, and writes documentation for every module. Your coding agent reads the same index over MCP, so its answers cite real files.

Free for 2 public repos, with a page like this one. No card. See how Repowise works

Prefer local? pip install repowise && repowise init indexes your own checkout, no account needed. Star Repowise on GitHub

chenglou/handwired FAQ

What is handwired?

Handwired is a TypeScript project that turns regular JavaScript numeric code into a neural net made of matrix multiplication and ReLU. It needs no training because the weights are written manually. The result stays exact and fully differentiable.

How does handwired work?

Handwired rewrites if-else branches, loops and state as arithmetic built from addition, multiplication and ReLU. It then collects these operations into one large matrix multiplication. That matrix can run in JavaScript on the CPU or on WebGPU.

What language is handwired written in?

Handwired is written mainly in TypeScript, with 706 TypeScript files out of 955 in the repository. It also contains two Swift files.

How is the handwired code organized?

Handwired keeps its shared building and compiling code in src and a runnable template entry point in template/main.ts. The scripts directory builds and serves the demo site, and lab holds older experiments that can be checked or ignored.

Who is handwired for?

Handwired is for developers who want ordinary single-threaded JavaScript code to run as an exact, differentiable neural net. It also suits anyone who wants to train those weights or combine the program with a generic network.

What license does handwired use?

Handwired is released under the MIT license.

Code health

7.1out of 10Good

Hotspots average 5.7, the place fixes pay off most.

On the leaderboards:#46 of 70 TypeScript repos

Key features of handwired

  • Replaces if-else branches, loops and state with addition, multiplication and ReLU so the program stays exact and differentiable.
  • Writes the weights by hand, so the generated network does not need training.
  • Collects the arithmetic into one large matrix multiplication that can run on JavaScript or on WebGPU.
  • Allows the weights to be unfrozen and trained, or a specific frozen program to be attached to a generic neural net and trained end to end.

How chenglou/handwired 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.

The codebase has 955 files and 9,173 symbols in 6 modules, led by TypeScript and Swift. Code health is 7.1 out of 10, rated good.