Research

Handwired Compiles JavaScript Directly Into Neural Nets

Former React core developer Cheng Lou has released Handwired, an open-source compiler that converts JavaScript into fully differentiable neural networks without requiring any prior training.

AlphaSignal1 day agoResearch
Image: AlphaSignal

Former React core team engineer Cheng Lou has introduced Handwired, an open-source compiler that translates traditional JavaScript code directly into neural networks without training loops. The project lowers standard programming constructs, such as conditional statements and loops, into matrix multiplications paired with Rectified Linear Unit (ReLU) activations. By assigning fixed, compiler-derived weights to these tensor operations, Handwired generates deterministic neural networks that execute using standard JavaScript or WebGPU hardware acceleration.

Developed in TypeScript under an MIT open-source license, Handwired runs locally using the Bun runtime. To showcase the concept, Lou released several live demonstrations, including HandwiredOS, a miniature operating system that operates with roughly 9,909 weights across 130 layers and renders to normal DOM elements. Additional demos feature a trainable image gallery and a tool capable of executing search queries across 100,000 JSON records on WebGPU. Control flow is mapped to numerical data flow by calculating all possible branch outputs and filtering them through arithmetic selection gates.

While framed as an exploratory toy project, Handwired highlights how deterministic code and differentiable computing share a common foundation. Because the emitted programs remain fully differentiable, practitioners can unfreeze the compiled weights and fine-tune their behavior through standard backpropagation. This bridges conventional software engineering with deep learning infrastructure, allowing compiled programs to benefit directly from neural network tooling like automatic differentiation, kernel fusion, matrix sparsity, and GPU hardware scheduling.

This is our own summary of reporting by AlphaSignal

More in Research