Handwired compiles JavaScript apps into differentiable neural nets you can run backwards

Vjeux · x · 2026-10-18

@chenglou released a toy project called Handwired: it turns regular JavaScript code into a neural net — no training, exact outputs matching the JS program, and fully differentiable, all running in a browser without a GPU.

User anshuc built a handwriting-input calculator on top of it: the app looks like a normal web app but is actually a single neural net running every frame, simultaneously rendering the UI and recognizing handwriting. The recipe: write the calculator in JS, compile it to an NN with Handwired, then splice a handwriting recognition model directly into the weights.

The truly cursed part: since the whole app is an NN, it can run in reverse — start from an answer, and gradient descent flows backwards through both handwriting and app logic to find inputs that produce that answer.

Original post →

More from Fun

Fun channel →