handwired
by chenglou
Handwired converts ordinary JavaScript code, such as if-else branches, loops and state, into a neural network made of matrix multiplications and ReLU-style operations. The weights are written by hand rather than trained, so the result is exact and can still be differentiated, and it can run on the CPU or on WebGPU.
- Stars
- 2.1k +15 a day
- Licence
- MIT
- Runs on
- Your computer
- Setup
- Technical
- Language
- TypeScript
- Age
- 15 days
What you can do with it
- Convert simple JavaScript logic into a matrix-based neural net that gives exact results
- Run the converted programs in JavaScript or on the GPU through WebGPU for parallel speed
- Unfreeze the hand-written weights and train them, or attach a fixed program to a larger neural net
Ways a business could use it
- Speed up heavy search or filtering logic over large datasets by running it in parallel on the GPU
- Prototype research that combines fixed rule-based logic with trainable models without writing GPU code
Can you use it commercially?
Free to use, change and sell, including in paid products. Keep the copyright notice.
Not legal advice. Read the project's licence file before building a product on it.
Getting it running
Clone the repository, run `bun install`, then `bun start` to launch the demos locally; live demos are also online.
Follow the official instructions in the project README.
Things to check
- Experimental research project rather than a polished product
- Only a limited subset of JavaScript can be converted
- Requires Bun and a WebGPU-capable browser for GPU use
Who's talking about it
- marc-ko (daily-trending-repo): Latest 10 Trending Repositories - October 21, 2026 Featured in a roundup
Checked 29 Oct 2026. Summary drafted by AI from the project's README.