Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
exact

exact

> 设计协作
Free

Write an app once. It runs natively on the web, macOS, iOS, and Linux, and an AI agent can build it,

2.2K stars0 likes6 views
GitHub

About

Write an app once. It runs natively on the web, macOS, iOS, and Linux, and an AI agent can build it,

Exact

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 controls

One 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 under llp/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.

Contents

  • Three principles
  • How it works
  • Quick start
  • Contract
  • Example apps
  • What works today, and what doesn't yet
  • Repository map
  • Working on Exact

Three principles

1. Agent native

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.

  • Ten operations, the same on every host. 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.
  • The clock belongs to the agent. Between two operations nothing moves. Instead of sleeping until an animation finishes, the agent says clock +60000 or clock settle and reads the result. No timing flakes, no waits.
  • Tests are scripts of those operations. An app.test.contract file runs unchanged on any host, with no second evaluator.
  • Every tool speaks to machines. 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.
  • Contract is small on purpose. A whole app fits in a context window. Every write is declared, every list is keyed, every value is typed. Mistakes are refusals that say what to do, not quiet misbehavior.
bash
bun scripts/agent.mjs web tree "tap change-station" "type station-search Palo" \
  "clock +60000" state "screenshot out.png"

2. Speed is king

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:

  • The boot path executes and compiles nothing. TypeScript is compiled to Hermes bytecode at build time and loads after the first pixel. The first frame comes from data baked into the plan.
  • Pay only for what you use. GPU rendering, the Markdown editor, text flow, and browser SQLite are separate artifacts, loaded on demand. Nothing is a feature flag on a core crate.
  • The web gets its own small runtime. On the RealWorld ("Conduit") benchmark, Exact's runtime was up about 300 ms before the React SSR build had hydrated. It used 26 KB of code against React's 81 KB (LLP 1071).
  • Edits land in about a tenth of a second. On a fresh app made by exact new, a saved Contract or TypeScript edit was rebuilt and in the page in 99 ms.

3. Write the web, ship the platform

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)

  • Layout is CSS's, because a person can't see a layout default, only its result. A bare node is display: block, box-sizing: content-box, flex-direction: row, flex-shrink: 1, the same as a bare ``.
  • Names are CSS's, because names are what you write: 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.
  • Unsaid presentation is the platform's. Text is the system's label colour and size (17 points on an iPhone, 13 on a Mac, the reader's setting in a browser), a button is the system's button, a pushed screen has the system's Back. An app that says less looks more at home.
  • The browser is the parity oracle for layout and for what you wrote. Native layout given the same inputs, Canvas 2D, SVG, gradients, and authored motion are checked against what Chrome draws.
  • The web is also the development loop. You work on the seconds-long web loop, and the native hosts are swept behind you.
  • Any unavoidable deviation in layout is declared, with its reason, in 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.

How it works

mermaid
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 -.-> R
  • Contract (contract/) 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.
  • The runner (runner/) is the plan's virtual machine. It handles keyed component instances, events, timers on a seekable clock, and the data seam.
  • The kernel (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.
  • Hosts (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.
  • Data sources sit below one seam. TypeScript runs on Hermes on native hosts and in the browser's own engine on the web. Rust runs natively, and can be replaced live (as a shared library, or as Wasm on iOS and the web). Every answer is checked against the shape Contract declared. Grants control network, files, SQLite, and secrets.
  • Optional pieces are separate artifacts: a wgpu GPU module (Metal on Apple, WebGPU in the browser), native modules (a hyphenated tag backed by a platform widget, like MapKit), and a game engine add-on.

Quick start

These steps were run on macOS on Apple Silicon. Linux works for the web loop and the Linux host.

1. Install the tools

  • 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):

    bash
    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

> Tags

ai-agentsappkitcoding-agents

No comments yet. Be the first to share.

> Details

PublishedNov 11, 2026
UpdatedNov 11, 2026
Category设计协作
PricingFree

> Related tools

F
Figma
协作式界面设计工具
S
sketch-wakatime
Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
Q
QuickColor
Quickly apply fills from the global or document color palettes to selected elements - 🎨