Vercel Labs compiles React UI into a pure math function, unlocking calculus for interfaces

shuding · x · 2026-10-27

Vercel co-founder Shu Ding released a Vercel Labs research prototype, The Calculus of Interfaces: compiling an ordinary React component <Dashboard/> into a real pure math function UI = f(props).

How it works: inspired by chenglou's Handwired, the page is written as a straight list of 2,608 operations with no branches or loops. Every operation is a weighted sum, product, ReLU, or step function — if becomes a step blending both outcomes, Math.max becomes a ReLU. f is piecewise smooth, and the same op list supports four evaluation modes: exact, sigmoid-softened, forward-mode differentiation, and interval arithmetic.

Once UI is math, you can differentiate it to tune the design for all devices at once, prove layout rules for every screen width, find discontinuities, integrate over real device distributions, compress it like a signal, soften it until it animates itself, and even evaluate the page at an imaginary width like 720+42i px.

Limits: pages must be hand-written in this form (no automatic conversion from existing React/HTML yet); text wraps by character count with monospace fonts; proofs assume exact arithmetic.

Related event: Vercel's The Calculus of Interfaces Compiles React UI into Math Functions(11 posts)→

Original post →

More from Research

Research channel →