
Write an app once. It runs natively on the web, macOS, iOS, and Linux, and an AI agent can build it,
Write an app once. It runs natively on the web, macOS, iOS, and Linux, and an AI agent can build it,
Write an app once. It runs natively on the web, macOS, iOS, and Linux, and an AI agent can build it, run it, see it, and test it on every one of them.
[!TIP] Try it with a coding agent. On a Mac with Xcode, Rust, Bun, and Chrome installed, give Claude Code this prompt:
Clone https://github.com/expo/exact and follow its README to make a new Exact app with `exact new`. Run `bun scripts/exact.mjs setup` once first. Make a todo list where I can add items, check them off, delete them, and see how many are left. Put the view in Contract and keep the list in `app.ts`. Write an `app.test.contract`, pass it on web, macOS, and the iOS Simulator with `scripts/agent.mjs`, then open the app for me on all three.A fresh agent given the earlier version of this prompt on a clean clone (2026-10-04, Hermes already in the machine cache, Cargo's cache warm) finished in about 57 minutes, and its tests passed on all three platforms. About 25 of those minutes were the first macOS and iOS builds, roughly 13 minutes each; later builds take a minute or two. On a machine that has lacked Hermes, its source build came first and added time. Current setup downloads and verifies the pinned host/iOS bundles once instead; ordinary builds stay offline.
Web
iOS
macOS
The browser's own DOM and CSS
UIKit views, native controls and the system's tab bar
AppKit views and native controlsOne app.contract, the same screen on three hosts, captured by the agent driver. Softwear is a demonstration store you can generate from exact-templates: it shows Alternative Apparel's catalog, is not affiliated with that brand, and takes no real orders or payments.
Exact is a cross-platform application runtime. You describe your interface in Contract, a small declarative language, and you write your data logic in TypeScript or Rust. The Contract compiler turns the interface into a compact plan. On the web, that plan becomes one ES module over a ~20 KB runtime that drives the real DOM. On macOS, iOS, and Linux, a Rust runner executes the same plan, a Rust layout kernel computes every box with CSS rules, and each platform draws with its own tools: AppKit, UIKit, or a GPU painter. There is no webview and no JavaScript bridge in the UI, and no app JavaScript runs before the first pixel.
[!NOTE] Exact is pre-1.0 and changes daily. There is no API stability, no backwards compatibility, and no migration guide, by design (
rules/DEFERRED.md). This repository,exact2, is a rebuild of an earlier one ("exact1"). Its design documents are imported underllp/research/as research, never as authority.
Upgrade note (2026-10-16): Snapback mutation replies with ok: false now throw
refused(why) and expose failure(slot); see the
before/after and inherited-app commands.
Exact assumes much of the code will be written by AI agents. An agent can make an app, run it, look at it, operate it, and prove it works without a person in the loop.
tree · screenshot · tap · type · state · layout · logs · clock · prefer · perf drive the web, macOS, iOS (Simulator or a real
iPhone), and Linux through one script, scripts/agent.mjs. There are ten on purpose:
the predecessor's agent API grew to eighty wire names, one reasonable addition at a
time.clock +60000 or
clock settle and reads the result. No timing flakes, no waits.app.test.contract file runs unchanged
on any host, with no second evaluator.contract build --json gives diagnostics with
stable ids and source ranges. contract symbols gives navigation. A development
source map leads from any node on screen back to the line that declared it.
The driver refuses to drive a build older than its sources and names the rebuild.bun scripts/agent.mjs web tree "tap change-station" "type station-search Palo" \
"clock +60000" state "screenshot out.png"Speed of the app and speed of the loop. Each budget in rules/RULES.md is tracked on
every commit, and a regression is a P0 with a name on it.
| Budget | Target |
|---|---|
| Cold start to interactive first frame | 100 ms p50 |
| Dev restart, edit to present | 100 ms p50 |
| App JavaScript executed before first pixel | none |
| Touch one line, rebuild that crate | 30 s |
| The whole blocking check suite | 65 s |
How the design keeps those numbers:
exact new, a
saved Contract or TypeScript edit was rebuilt and in the page in 99 ms.What you write is CSS: the vocabulary, the layout model, the development loop. What you leave unsaid is the platform's: controls, colour, type, motion, gestures, the keyboard and accessibility come out as an app built by hand with UIKit or AppKit would have them, and on the web as a carefully built web app would. What you write wins. The order is author, then platform, then CSS's default, and one test settles a dispute: would someone who knows the platform notice? (LLP 1115)
display: block, box-sizing: content-box, flex-direction: row,
flex-shrink: 1, the same as a bare ``.font-size, object-fit,
text-overflow, line-clamp, light-dark(), env(safe-area-inset-top). The compiler
refuses an alias and names the web's spelling.button is the
system's button, a pushed screen has the system's Back. An app that says less looks
more at home.llp/1001-kernel-v1.spec.md. For example, Taffy has no
position: static.Writing the web doesn't mean the lowest common denominator. Where a platform can do
more (real HTML in an SVG foreignObject on the web, MapKit through a native module on
Apple), Exact lets it.
flowchart LR
subgraph author["You write"]
C["app.contract
view · state · actions"]
D["app.ts or a Rust crate
data sources"]
end
C --> K["Contract compiler"] --> P["plan
tables + bytecode"]
P --> W["Web
one ES module, ~20 KB runtime,
the browser's DOM and CSS"]
P --> R["Rust runner
+ layout kernel (Taffy)"]
R --> M["macOS
AppKit + CoreText"]
R --> I["iOS
UIKit + CoreText"]
R --> L["Linux
vello GPU / tiny-skia CPU"]
D -.->|answers, checked against declared shapes| W
D -.-> Rcontract/) is compiled in four passes: syntax, types, analysis, and
lowering. At build time the plan is baked: constant data is evaluated into it, so
the first frame needs nothing else.runner/) is the plan's virtual machine. It handles keyed component
instances, events, timers on a seekable clock, and the data seam.kernel/) is a columnar node arena with CSS layout through a patched
Taffy. The host measures text: CoreText on Apple,
cosmic-text on Linux. On the web, the browser lays out the same CSS itself, so the web
build carries no layout engine.host/) present the tree. The web host writes DOM nodes, and the browser
runs CSS transitions. The Apple host is a static library with a C ABI under AppKit and
UIKit presenters. The Linux host paints the tree itself, onto DRM/KMS with evdev
input, or into an offscreen buffer.These steps were run on macOS on Apple Silicon. Linux works for the web loop and the Linux host.
Rust through rustup. The pinned stable toolchain in
rust-toolchain.toml installs itself the first time Cargo runs.
Bun 1.4.2, the version package.json pins. Node and npm are
not needed.
Google Chrome. The agent drives the web through headless Chrome. Set CHROME to
use another Chromium.
Xcode 27.1 or later, for the macOS and iOS hosts (exact setup --check checks it).
Hermes, only for TypeScript apps on native hosts. Exact consumes Ibex's
pinned, attested 260318099.0.4 release bundle; ordinary Cargo builds are
offline and never download or compile an engine. Install it once for each
target before building (for this Mac, use aarch64-apple-darwin):
cargo run --manifest-path vendor/ibex/crates/hermes-lean-sys-installer/Cargo.toml -- --target The installer verifies the bundle and publishes it under
~/.cargo/hermes-lean-sys/. The v4 set supports macOS, Linux, Windows, iOS
devices and the universal iOS Simulator, plus tvOS devices and arm64 tvOS
Simulators. Linux and Windows select Ibex's English intl tier; Apple keeps
Hermes's OS-backed Intl.
HERMES_LEAN_SYS_DIR is only an explicit development
override, not normal setup.
To install the pinned Bun beside any existing installation:
curl -fsSL https://bun.sh/install | BUN_INSTALL=~/.bun-1.4.2 bash -s bun-v1.4.2.
Use ~/.bun-1.4.2/bin/bun for the commands below if it is not on your PATH.
bun scripts/exact.mjs setup installs the declared stable and web nightly Rust
toolchains, their components/targets (the nightly's clippy lints a g