Cheng Lou, the engineer whose past work includes React, Messenger, ReasonML and ReScript, published a project on X on 15 October that rewrites plain JavaScript as a neural network. He calls it Handwired, and he calls it a toy project in the first line of his thread. It is a striking demonstration from a well-known developer, not a product or a research result.
The mechanism is the part to get straight, because it sounds like magic until it is explained. Nothing is trained to imitate the code. Handwired compiles the code. Each if-else branch and each loop is wired by hand into the network’s weights, which are the numbers a network multiplies and adds, so the finished network returns exactly what the original program returns. Lou’s own thread lists the claims as no training, exact outputs, and fully differentiable, all running in a browser without a GPU.
He answers the obvious objection himself. “Isn’t a neural net probabilistic? Yes if you train it, no if you hand-wrote the weights that correspond exactly to your program, lol.” The network is probabilistic only when its numbers come from training. Here they come from the program, so the behavior is as deterministic as the code it started as.
Lou’s first demo is a small operating system with large scroll views, text input, animation and styling. He says you can open the browser inspector and see ordinary page elements, with no diffusion model and no language model producing them, even though the source on GitHub is a pile of compiled network. The second is a search across 100,000 JSON documents, in which the code was written mostly the traditional way and then turned into WebGPU matrices so the work runs in parallel. By his description, the regex, the parsing, the highlighting and the matching are all one exact network.
The more interesting idea sits in the third demo, and it depends on that word “differentiable.” A network can be adjusted by training because you can calculate how each weight nudges the result, which is what makes learning from examples possible. A compiled program inherits that property. So Lou asks what happens if you unfreeze some of the weights and train them. Existing techniques, losses and backpropagation among them, apply, and in his photo gallery the interface becomes, in his words, “a bit more ‘learned’.”
Today those are mostly separate worlds. You either write deterministic logic that does precisely what you said, or you train a model and accept a black box. Handwired points at a middle: keep the parts you can specify exactly, and release only the parts you cannot. That is a demonstration of a direction, shown on his own examples, and the thread does not claim more.
He also floats a speculative use: attaching a specific compiled program to a small language model such as nanoGPT, so the model could speak Shakespeare and also run one exact piece of JavaScript. He presents it as something you can imagine, not something he built.
The limits are plain from the thread itself. It contains no benchmark, no comparison against other approaches, no performance figures and no independent evaluation, so nothing here says it is faster, smaller or better than running the same code normally. The thread drew about 1.2 million views, which measures reach and says nothing about whether the approach holds up. Lou’s profile says he is currently at Midjourney, but nothing in the thread connects the project to it.
The code and a tutorial are public at chenglou.me/handwired and github.com/chenglou/handwired. For anyone who builds learned systems, the cheapest way to test the idea is to run the tutorial and see whether unfreezing a single piece of exact logic gives something you could not get by writing the rule or training the model alone.
Based on a thread by Cheng Lou (on X), 15 October 2026.