chenglou/handwired
Machine LearningCompiles ordinary JavaScript control flow into differentiable matmul-and-ReLU graphs so programs run GPU-parallel without training.
The problem
Most interesting code is control flow: branches, loops, mutable state. GPU kernels and neural-net runtimes are built for dense arithmetic, so getting a normal program onto the GPU usually means rewriting it in a kernel language or a tensor DSL. Handwired takes the opposite route: it lowers JavaScript if-else, loops and state into matrix multiplication plus ReLU over floats, then executes that graph in JS or WebGPU. The README's own example converts a ternary on a constant into two ReLUs that act as an indicator, so both branches compute and one is selected arithmetically.
What's different
Compared with array-oriented tensor frameworks such as PyTorch, Handwired is not a library you write models in; it is a transform over program structure. Compared with writing WebGPU compute shaders by hand, you keep ordinary single-threaded JavaScript and let the compiler find the parallelism. Two capabilities actually stand out: because the output is only matmul and ReLU, the whole program is differentiable, so frozen weights can be unfrozen and trained, or a frozen program can be attached to a generic net and trained end-to-end. And because the primitive set is so small, existing GPU optimizations like fusion, sparsity and reordering have an easy target.
Who it's for
Good for researchers and compiler-curious engineers who want to probe odd questions: what happens when you train a program's constants, or how to run a branching search over 100k documents on the GPU from plain JS. The demo of a JSON search finishing in milliseconds is the most concrete pitch. It is not for teams shipping production inference today: nothing in the README suggests API stability, error handling, or coverage of real-world JS semantics, and the "no training, exact" claim holds for the toy examples shown, not for arbitrary code. If you need a mature GPU tensor library or a model-serving stack, look elsewhere.
Cost of adoption
The README is honest about being early: clone, bun install, bun start, and read docs/, src/ and template/ to get going. That means a Bun runtime and a willingness to read source rather than documentation. The project is MIT-licensed, so licensing is not a blocker. The main risks are maturity and semantic coverage: the README is a concept pitch plus demos, and lab/ is explicitly described as old experiments to check or ignore. Numeric behavior on floats, handling of unbounded loops, and how much of JavaScript is actually supported are not specified in the provided material, so treat claims as directions rather than guarantees.
Verdict
Handwired is a genuinely unusual idea: program-to-differentiable-graph compilation, with a small enough primitive set to make GPU optimization tractable. But the HotRepo signals say this is a brand-new project, nine days old, with about 1,984 stars and a fast start on the new TypeScript board rather than a long tracked history; one quiet Hacker News thread is the only external discussion. That pattern means a spike, not an established tool. Worth an afternoon if you enjoy compiler and autodiff experiments or want to test the train-a-frozen-program angle; not worth depending on until the semantics and API are documented.
Hacker News
Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.