1.6What's new

You direct.
Agents build.

Whole engine in one prompt. Everything else is your app.

Get StartedCopy the engine
<1 KBbrotliFastZero dependenciesNo build step
RunnablePlayground
define('counter', {
    $({ count = 0 }) {
        return [
            mx.button({ onclick: _ => this.$({ count: count - 1 }) }, '-'),
            mx.span(count),
            mx.button({ onclick: _ => this.$({ count: count + 1 }) }, '+')
        ];
    }
});

document.getElementById('app').render(mx.counter());
Reconciles the real DOMrender() reconciles against the nodes already on the page and adds none of its own.
Four API bindingsmx, dom, define and components, plus render() on every element.
No build stepOne script tag. The example runs as written.
Fits in a system promptThe minified engine is 2,322 bytes of source, about 900 tokens, so it goes into the prompt as code rather than as a reference.
The mental model

Four names that work the same way

mx

Describes

mx.div(...) returns a lightweight description, a small marked array, so no JSX or build tooling is needed.

dom

Creates real nodes

Same syntax, returns a real element. Build it now, keep the reference, mount it anywhere.

render

Reconciles

el.render(...) diffs descriptions against live children. The attribute cache skips anything unchanged.

define

Registers components

A tag with state and methods: this.$({ count }) merges into its state and re-renders it.

Why it exists

What frameworks cost an AI

The next million apps won't be scaffolded with npm install. They'll be prompted into existence as single files that get generated and thrown away, so the engine behind them should be small enough to fit in a system prompt.

Tokens spent on setup

In a typical framework project, imports, build setup and config files are tokens the model reasons about but the user never sees, and all that setup is paid for in inference.

Config the model gets wrong

AI often gets bundler and compiler configuration wrong, and a broken config stops the whole app before any of your code runs. mx works as a raw script tag. Minify if you like, but there's nothing to configure.

API surface

Every extra API, such as useEffect, useMemo, forwardRef, Suspense or Server Components, is one more thing a model can make up. mx exposes four API bindings: mx, dom, define and components.

Weight mismatch

React 19 + ReactDOM is about 60 times the size of mx. A smaller surface leaves less to misuse or hallucinate, and less to debug when the AI gets it wrong.

Performance

Why smaller ends up faster

Every framework runs the same app with identical data and CSS, as a production build in Playwright headless Chromium.

Paint-synchronized sort

Frame time at 120 Hz, where the budget is 8.33 ms. mx fits with ~2 ms to spare.

Full methodology

Three suites on M1, M4 Pro and M5 Pro hardware. Where a competitor wins, it's listed.

Why it's fast
  1. mx: 6.24 ms
  2. Angular: 7.28 ms
  3. React: 7.32 ms
  4. Vue: 10.94 ms
  5. Svelte: 11.66 ms
Heap per 500 ops
~12KB
Svelte: 6.98 MB. React: 925 KB.
Per-node diff
0.78µs
Angular 0.83, Svelte 1.15, React 1.39.
Same app, total JS
~2KB
Brotli. React + ReactDOM: ~59.3 KB.
Size

Whole applications stay small

The engine is only part of it. A production app with 200+ components ships about 100 KB of JS and 50 KB of CSS gzipped, while framework apps of similar scope typically ship 5 to 10 times as much. Live data, forms and dozens of views stay this small because there's no machinery between your code and the DOM.

Production app, JS
~100KB
Gzipped, 200+ components.
Same app, CSS
~50KB
Gzipped.
Framework app, similar scope
5-10×
Gzipped, typical, against the app above.

The engine itself

Brotli size next to mx, with ReactDOM counted in React and hooks in Preact, and how you usually write code for each. Angular and Svelte have no runtime file of their own, so their figure is a hello-world production build that grows as you add components. Dependencies are the packages each one installs besides its own, not counting build tooling.

Engine size in brotli as a multiple of mx (React with ReactDOM, the Vue runtime-only build, Preact with hooks, a hello-world production build as the baseline for Angular and Svelte), how code is written, dependencies and server rendering for each
FeaturemxPreactSvelte 5Angular 22Vue 3React 19
Size (brotli)<1 KB~5x~8x~30x~35x~60x
Usual syntaxPlain function callsJSX.svelte componentsDecorators and templatesSingle-file componentsJSX
Without a buildRuns as writtenWith htmNot possible, it's a compilerNeeds the JIT compiler, no decoratorsNeeds the template compiler, no SFCscreateElement or htm
DependenciesNoneNoneAbout 20, compiler included2About 20, compiler included1
Server renderingNeeds a DOM librarySeparate packageBuilt inSeparate packagesBuilt inBuilt in
Existing server HTMLAny matching markupAny matching markupIts own output, with markersIts own output, with markersIts own server outputIts own server output

Give your AI an engine that fits in its context

The minified engine is about 900 tokens of source with no dependencies, so all of it fits inside a system prompt as code rather than as a reference.