# handwired.wiki > Independent learning resource and live demo gallery for Handwired, Cheng Lou's open-source project that turns regular JavaScript code into a neural net: no training, exact, yet fully differentiable, runnable in a browser without a GPU. Upstream: https://github.com/chenglou/handwired (MIT) and https://chenglou.me/handwired/. Key facts: - Handwired programs are fixed lists of FP32 operations: weighted sums (circuit.affine), products with a ReLU (circuit.reglu), boolean rounding (circuit.boolean) and table reads (circuit.indexRead). - You write builder code (ordinary JavaScript that runs once and appends operations to a Circuit); no tool converts existing JavaScript source automatically. - Example: `a > 4 ? 10 : 12` becomes `above4 = relu(a - 4) - relu(a - 5); result = above4 * 10 + (1 - above4) * 12`. - Not published to npm; clone the repo and use Bun, or depend on it via git ("github:chenglou/handwired#"). - handwired.wiki is not affiliated with Cheng Lou; it is run by En Dash Consulting (https://endash.us). ## Guides - [When would you want your JavaScript to learn?](https://handwired.wiki/): Handwired by Cheng Lou turns ordinary JavaScript logic into an exact, fully differentiable neural net that runs in the browser without a GPU. Live demos, tutorials and FAQ. (markdown: https://handwired.wiki/md/index.md) - [Demo gallery](https://handwired.wiki/pages/gallery.html): Every Handwired demo in one place: live in-browser demos on handwired.wiki plus Cheng Lou's upstream Mini OS, Learned gallery and 100,000-document JSON search. (markdown: https://handwired.wiki/md/gallery.md) - [Why Handwired?](https://handwired.wiki/pages/why-handwired.html): Why write JavaScript as a neural net? Handwired programs are exact like code, differentiable like models, and parallel like GPU kernels. The idea behind Cheng Lou's project. (markdown: https://handwired.wiki/md/why-handwired.md) - [Handwired concepts](https://handwired.wiki/pages/concepts.html): How Handwired turns if/else, comparisons and min/max into ReLU circuits over FP32: cells, wires, builder code, emitCompare, emitSelect, exactness and gradients. (markdown: https://handwired.wiki/md/concepts.md) - [Getting started with Handwired](https://handwired.wiki/pages/getting-started.html): Step-by-step: clone chenglou/handwired, run its demos with Bun, start from the toggle template, or add Handwired to a Vite + TypeScript project as a pinned git dependency. (markdown: https://handwired.wiki/md/getting-started.md) - [About handwired.wiki](https://handwired.wiki/pages/about.html): handwired.wiki is an independent learning resource and demo gallery for Cheng Lou's Handwired, built by En Dash Consulting. Attribution, licensing and sources. (markdown: https://handwired.wiki/md/about.md) ## Interactive demos - [Ranking that learns from clicks, and keeps its rules](https://handwired.wiki/pages/ranking.html): A hand-written search ranking formula runs as an exact Handwired neural net, learns its four weights from 1,000 simulated shoppers, and keeps 'pinned first' and 'out-of-stock never in the top 10' exact. A generic neural net trained on the same clicks breaks both rules. (markdown: https://handwired.wiki/md/ranking.md) - [Layout that learns from a designer's drags](https://handwired.wiki/pages/layout.html): A card-sizing function runs as an exact Handwired neural net. Drag a few cards to the widths you want; three constants learn from the drags, every card at every screen width follows, and nothing ever overflows. A generic net on the same drags does. (markdown: https://handwired.wiki/md/layout.md) - [Physics that learns from a recording](https://handwired.wiki/pages/physics.html): A ball's physics step (gravity, drag, bounce) is unrolled into one Handwired neural net and fitted to a recorded path by gradient descent. The constants converge, a new throw follows the real ball, and the floor stays exact. A generic net fitted to the same path can't handle a new throw. (markdown: https://handwired.wiki/md/physics.md) - [Colour themes that learn, and stay accessible](https://handwired.wiki/pages/color-themes.html): A theme function (background, card, text, captions, links, buttons for light and dark) runs as an exact Handwired neural net and learns its constants from a designer's colour picks, while every text pair keeps WCAG AA contrast, checked across 36 hues after every step. A generic net on the same picks fails contrast. (markdown: https://handwired.wiki/md/color-themes.md) - [Search 100,000 JSON documents on the GPU](https://handwired.wiki/pages/gpu-search.html): Cheng Lou's Handwired JSON search, embedded with credit: regex matching and JSON parsing written as plain-looking JavaScript, compiled to WebGPU, timed against native RegExp, with a CPU fallback when WebGPU is missing. (markdown: https://handwired.wiki/md/gpu-search.md) - [The cat is a neural net](https://handwired.wiki/pages/js-vs-nn.html): A 7-step interactive lesson: a tiny JavaScript function that decides how hard a cat jumps becomes an exact Handwired neural net. Poke it, try to break it, then watch it learn new constants in its own code, next to a regular neural net. (markdown: https://handwired.wiki/md/js-vs-nn.md) - [Soft switch: an if/else made of ReLUs](https://handwired.wiki/pages/soft-switch.html): Interactive demo: the Handwired README's a > 4 ? 10 : 12 built as relu(a - 4) - relu(a - 5) and a select, evaluated by the real Handwired runtime as you drag a. (markdown: https://handwired.wiki/md/soft-switch.md) - [Exact comparison explorer](https://handwired.wiki/pages/compare-explorer.html): Interactive Handwired demo: compare two numbers with emitCompare, pick with emitSelect, take emitMinimumExact, see operation counts with and without a grid, and fuzz against JavaScript. (markdown: https://handwired.wiki/md/compare-explorer.md) - [Code → network](https://handwired.wiki/pages/circuit-graph.html): See what a JavaScript expression becomes in Handwired: every affine, reglu and select operation of a circuit, laid out by layer, built live by the real runtime. (markdown: https://handwired.wiki/md/circuit-graph.md) - [Unfreeze & train](https://handwired.wiki/pages/train.html): Interactive demo: start from an exact handwired program, unfreeze its threshold, slope and branch values, and fit new targets by gradient descent using Handwired's backpropagateReference. (markdown: https://handwired.wiki/md/train.md) - [Toggle switch template](https://handwired.wiki/pages/toggle.html): Upstream Handwired's template app running live: a toggle switch whose hit testing, arming and spring animation are one numeric program, checked against plain JavaScript. (markdown: https://handwired.wiki/md/toggle.md) ## FAQ - [Handwired FAQ](https://handwired.wiki/pages/faq.html): Answers about Handwired by Cheng Lou: what it is, whether it's a compiler, if it needs training or a GPU, how it stays exact and differentiable, and how to install it. (markdown: https://handwired.wiki/md/faq.md) ## Optional - [llms-full.txt](https://handwired.wiki/llms-full.txt): every page's full text in one file - [Upstream docs](https://github.com/chenglou/handwired/tree/main/docs)