Back to gallery
expo/exact on GitHub — 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.
expo
Built byexpo/

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.

Stars
5k
Forks
152
Watchers
5k
Open issues
52
RustMIT main Updated just now~228 stars/day lifetime
Editor's take

Exact is the Expo team's new all-platform app framework: one codebase renders to browser DOM on the web, UIKit on iOS, AppKit on macOS, Android Canvas with Material 3, and a Wayland painter on Linux, with Windows still early. UI is written in Contract, a small strictly typed declarative language, while logic lives in TypeScript (on Hermes bytecode) or Rust. The pitch is agent-native development plus hard speed budgets: 100 ms cold starts and a roughly 20 KB web runtime. The tradeoff is real: it is pre-1.0, there is no packaged release, you build from a checkout, and you learn a new UI language instead of JSX. 4,000+ commits already, MIT, about 5k stars.

Use this if

You are starting a greenfield app that must feel native on desktop and mobile and you can tolerate an API that changes daily.

Skip if

You need to ship to production this quarter; there is no stable release, and Expo with React Native is the safer path from the same team.

FrameworksMobile
Topics
ai-agentsappkitcoding-agentscross-platformcssioslinuxmacosnative-appsrustswiftuikitweb
Quick install
# Add to Cargo.toml:
cargo add exact

Inferred from Rust · always double-check against the official README below.

README — rendered from expo/exact(truncated)

Exact

The all-platform app framework. Agent native. Built for speed. No compromises.

Exact is an all-platform framework for building real apps on the web, iOS, macOS, Android, and Linux — with Windows in active development, plus tvOS, watchOS, Android TV, and the terminal.

Exact is not a "cross-platform" framework. Cross-platform tools usually trade away each platform's strengths to maintain a lowest common denominator. Exact takes the opposite approach: build something excellent on every platform on its own terms — real DOM on the web, real UIKit on iOS, real AppKit on macOS, hardware-accelerated Material 3 rendering with native Android views on Android, and direct GPU/CPU rendering on Linux and Windows. Being all-platform is simply the side effect of getting every platform right from one source.

Everything in Exact is built around three priorities:

  1. Agent Native — Built from the ground up so coding agents can build, run, see, operate, and verify real apps on every platform through one deterministic loop.
  2. Speed is King — 100 ms cold starts, 100 ms edit-to-present reloads, zero app JavaScript before first pixel, and a ~20 KB web runtime, held to hard budgets.
  3. No Compromises — Build Exactly What You Want — Native platform controls with zero tells when you leave presentation unsaid; full creative control over layout, motion, graphics, shaders, and native platform objects whenever you want it.

Note

Exact is pre-1.0 and changes daily. There is no packaged release, API stability guarantee, or backwards-compatibility layer yet — you build from a checkout of this repository.

Web iOS macOS
Softwear's hoodies page in Chrome Softwear's hoodies page as a native iOS app Softwear's hoodies page as a native macOS app
The browser's own DOM and CSS UIKit views, native controls, and the system tab bar AppKit views and native controls

One source, three platforms, captured by Exact's agent driver. Softwear is a demo store from exact-templates (it displays Alternative Apparel's catalog, is not affiliated with that brand, and takes no orders or payments).

Platforms

Platform Status How it renders
Web Works Browser DOM (~20 KB runtime, zero layout engine shipped)
iOS Works (Simulator & device) UIKit views, native controls, and system bars
macOS Works AppKit views and native controls (no SwiftUI)
Linux Works Exact's painter draws in a Wayland window, full-screen on a DRM/KMS console, or into a headless buffer.
Android Works (Material 3 polish in progress) Hardware-accelerated Android Canvas (RenderNode) with Material 3 styling, native EditText, dialogs, and Compose date pickers
Windows Early DirectX 11 (ink) or CPU painter (neutral look + Fluent symbols) with native file dialogs, IME, and UI Automation

The repository also ships tvOS and watchOS hosts, Android TV support in the Android APK, and a terminal host (exact-terminal) for command-line apps.

Contents


Why Exact?

1. Agent Native

Most frameworks bolt AI support on afterward with docs and wrapper scripts. Exact is designed around the agent loop so coding agents — and the humans directing them — can go from edit to verified native app on every platform without babysitting.

  • One driver operates every platform. The same 10 operations (tree, screenshot, tap, type, state, layout, logs, clock, prefer, perf) drive the web, macOS, iOS Simulator, physical iPhones, Linux, Android, and Windows through scripts/agent.mjs.
  • Deterministic, seekable time. In driven mode, time only advances when the driver moves the clock (clock +60000, clock settle). Agents and tests never sleep() waiting for animations or network timers, and never flake on timing.
  • One-command verification. bun exact.mjs verify (and verify ios) builds the app, runs all authored tests, checks light and dark mode, multiple screen widths, accessibility trees, dynamic-type overflow, and scroll feel in a single structured report.
  • Built to fit in context and fail clearly. UI is declared in Contract, a compact, strictly typed language with no hidden side effects, no data races, and one explicit boundary to app logic. An entire app fits in a model's context window; development builds map every rendered node back to its declaring line; and the compiler reports up to 20 structured, actionable diagnostics per run.

2. Speed is King

Startup speed and feedback speed are hard architectural constraints, not tuning passes added later. Every budget in rules/RULES.md is checked continuously — the gate on every change, the rest hourly — and regressions are bisected automatically to the breaking commit.

Budget Target
Cold start to interactive first frame 100 ms p50
Dev reload, save to present 100 ms p50
App JavaScript executed before first pixel None
Touch one line, rebuild that crate 30 s
Blocking gate, warm, after a one-crate edit 30 s

How Exact hits those numbers:

  • Zero compilation or app JS on the boot path. Constant data is baked into the compiled plan at build time so the first frame paints immediately. TypeScript compiles to Hermes bytecode ahead of time and loads only after the first pixel.
  • No webviews, no UI bridge. Native hosts execute the compiled plan directly in Rust; the web host compiles the plan to a single ES module over a ~20 KB DOM runtime.
  • Pay only for what you use. Heavy capabilities — wgpu GPU canvases, the Markdown editor, text-around-shapes, browser SQLite, and the optional game engine — ship as separate on-demand artifacts rather than bloating every app.
  • Measured against real apps. On the RealWorld ("Conduit") benchmark, Exact's web build ships 26 KB of code against React 19's 81 KB and becomes interactive ~300 ms before React SSR finishes hydrating.

3. No Compromises — Build Exactly What You Want

Exact refuses the classic false choice between "looks native, can't customize" and "fully custom, feels foreign." It makes every platform first-class so you never have to settle:

  • Native excellence with zero tells. Precedence is author → platform → default. One test settles any dispute: would someone who knows the platform notice? Leave colors, type sizes, and control chrome unsaid and each host uses its real controls, bars, typography, gestures, haptics, keyboard behavior, and accessibility — UIKit on iOS, AppKit on macOS, the browser's own DOM on the web. Saying less makes an app feel completely at home.
  • Full creative control when you want it. When you do want a bespoke design, Exact gives you the full power of web-standard layout and styling (verified against Chrome), complete SVG, Canvas 2D on every host, spring physics and velocity-preserving gestures, text flowing around arbitrary shapes, custom fonts, and wgpu GPU shaders (Metal on Apple, WebGPU on the web).
  • Direct access to every platform's native APIs. Over 60 first-party packages in packages/ expose camera, passkeys, HealthKit, notifications, geolocation, maps, payments, speech, and more. Need a custom platform widget like MapKit? Drop in a native module (exact-map) backed by Swift, Kotlin, or Rust. Need to configure the exact UIView, navigation controller, or DOM node Exact created? Attach an access hatch (hatch="name") and receive the real platform object directly.
  • Choose your data stack. Write app logic in TypeScript (running on Hermes natively and the browser engine on the web) or Rust (native or Wasm, with live replacement), or declare plain HTTP/GraphQL reads directly in Contract so native builds link no JavaScript engine at all.

All-platform vs. cross-platform

Traditional cross-platform frameworks try to unify platforms by drawing their own world over every OS or bridging one runtime across disparate UI trees. Exact instead focuses on making each platform native, fast, and complete on its own — and all-platform falls out as a side effect.

Exact React Native Flutter
Approach All-platform: native excellence on each host, one source Cross-platform JS bridge / JSI over native views Cross-platform custom rendering engine
Agent workflow Built-in 10-op driver + seekable clock on every host External tools per platform integration_test
JS before first frame None (baked first frame, bytecode loaded after paint) JS bundle boots before UI N/A (Dart AOT)
Native controls UIKit / AppKit on Apple; Material 3 + native EditText/dialogs on Android; painted on Linux & Windows Native views on iOS & Android Custom-drawn widgets everywhere
Web output Browser DOM (~20 KB ES module) Separate react-native-web library Canvas / WebAssembly
UI & logic Contract UI + TypeScript, Rust, or zero-JS HTTP JSX / React (JS or TS) Dart widgets & logic
Layout Web-standard CSS (Chrome as reference) Yoga (column-first, no shrink) Custom constraint model

Honest trade-offs: React Native and Flutter are mature ecosystems with versioned releases, massive communities, and vast plugin registries (npm and pub.dev). Exact is pre-1.0 and changes daily: there is no packaged CLI or JSX/React layer, React Native and Flutter plugins do not work (data modules can import pure-JS npm packages, while platform APIs come from packages/), Windows is still early, and Android's Material 3 polish is still being completed.


Quick start

These steps target macOS on Apple Silicon. Linux supports the web dev loop, the Linux host, and iOS cross-compilation. Windows supports the web dev loop and the Windows host (use WSL 2 with Ubuntu 24.04 for iOS builds).

1. Prerequisites

  • Rust via rustup (the pinned stable toolchain in rust-toolchain.toml installs automatically on first build).
  • Bun 1.4.2, pinned in package.json (Node and npm are not needed). To install alongside another Bun version:
    curl -fsSL https://bun.sh/install | BUN_INSTALL=~/.bun-1.4.2 bash -s bun-v1.4.2
  • Xcode & Swift (macOS Apple builds only): Swift 6.4+ and the SDKs for each platform you target — macOS 26.0, iOS 27.1, or tvOS 27.0 (host/apple/devices.mjs). DEVELOPER_DIR or TOOLCHAINS overrides xcrun's default.

2. Clone and run one-time setup

git clone https://github.com/expo/exact.git
cd exact
bun scripts/exact.mjs setup

setup provisions the rest once: pinned Rust toolchains and targets, wasm-bindgen, Binaryen (~/.cache/exact/binaryen), Bun dependencies, Playwright's Chromium (CHROME overrides it), offline crate caches, and attested Hermes bundles for TypeScript apps on native hosts. Run bun scripts/exact.mjs setup --check at any time to check prerequisites without changing your machine.

3. Let a coding agent build your first app

On a Mac with Xcode, Rust, and Bun installed, give Claude Code (or another coding agent) 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.

4. Or create and run one yourself

bun scripts/exact.mjs new ../hello          # or `bun link` once, then `exact new ../hello`
cd ../hello
bun exact.mjs contract types app.contract -o app.contract.d.ts
bun exact.mjs web                           # dev server at http://127.0.0.1:8765/
bun exact.mjs test web                      # runs *.test.contract
bun exact.mjs mac --run                     # native macOS app
bun exact.mjs ios --run                     # iOS Simulator (--device --run for a connected iPhone)

exact new scaffolds a standalone app: app.contract (UI), app.ts (data), app.json (manifest), and app.test.contract (tests). Native builds compile inside .exact/shells/, referencing your Exact checkout by path.

  • Build times: The first web run builds the toolchain in a few minutes; edits then rebuild and reload in ~100 ms. A first native macOS or iOS build takes 10–15 minutes on a laptop; subsequent builds take 1–2 minutes.
  • Choosing a simulator: Set EXACT_SIM to a simulator name or UDID (or pass --sim) and keep it set for agent.mjs ios.
  • Check pixels, not just assertions: Run bun exact.mjs verify or bun exact.mjs agent <host> "screenshot out.png" to inspect rendered layouts on every host.
  • Next reading: docs/start-here.md for apps or docs/start-here-site.md for websites. That single guide is the only required reading; everything else in docs/ is lookup reference.
Run an included example app, serve on LAN, or upgrade an existing app

Run Caltrain (the v1 reference app) directly from the Exact checkout:

bun host/web/dev.mjs                    # Web at http://127.0.0.1:8765/
bun host/apple/build.mjs --run          # macOS
bun host/apple/build.mjs --ios --run    # iOS Simulator
bun scripts/build-linux.mjs caltrain    # Linux (Wayland window, DRM/KMS console, or headless)

Add --lan to dev.mjs to open the page from a phone on your local network (unrecognized Host headers receive 421 against DNS rebinding; use --allow-host <name> for tunnels). For Linux KMS rotation (EXACT_ROTATE) and VNC (EXACT_VNC), see docs/reference.md.

Run or install in-repo apps on macOS:

bun scripts/exact.mjs list
bun scripts/exact.mjs run markdown README.md
bun scripts/exact.mjs install markdown  # installs `mdview` on PATH

Upgrade an app created with an older checkout:

bun exact.mjs update
bun exact.mjs contract migrate app.contract
bun exact.mjs lock
bun exact.mjs contract build app.contract --json --errors-only

See Upgrading an inherited app for manual steps.


The agent loop

Driving any built host uses one consistent command surface (bun scripts/agent.mjs --help lists every operation and flag):

# Drive an app from the Exact checkout
bun host/web/build.mjs caltrain-web
bun scripts/agent.mjs web tree "tap change-station" "type station-search Palo" \
  "clock +60000" state "screenshot out.png"
bun scripts/agent.mjs web --test apps/caltrain/app.test.contract

# Drive an external app created with `exact new`
EXACT_APP_DIR=../hello bun host/web/build.mjs hello-web
EXACT_APP_DIR=../hello bun scripts/agent.mjs web --app hello tree "screenshot hello.png"
  • Switch hosts with one argument: Swap web for macos, ios, linux, android, or windows once that host is built. Android reader drives refuse film capture and play layers only with --live (record with adb shell screenrecord).
  • Film motion deterministically: "screenshot film.png over 600 every 50" advances the seekable clock and outputs a contact sheet (use .apng for an animation).
  • No stale-build traps: The driver refuses to drive a build older than its sources and prints the exact rebuild command.
  • Performance tracing: perf attributes work by plan site, perf frames reports game frame pacing, and trace inspects captures saved from a running app or connected phone.
  • Opt-in friction notes: An app's AGENTS.md asks agents to log rough edges with bun exact.mjs feedback note "<what happened>". Notes stay local in .exact/ with only Exact's commit and the last command's verb, exit code, and duration — never code or command output. Sending to Expo is opt-in (bun exact.mjs feedback never disables it per project; EXACT_FEEDBACK=0 disables it machine-wide; see docs/diary.md).

How an Exact app is written

Exact separates declarative UI (Contract) from data logic (TypeScript, Rust, or declarative HTTP). Contract uses standard CSS layout and property names so agents and web developers already know the vocabulary — without shipping a browser engine to native platforms.

The smallest useful app is a single file. It specifies no color, font, or size, so every platform draws its own native button:

component App
  state count = 0
  action increment
    count = count + 1
  view
    button press=increment
      text `Count: ${count}`

A complete Todo app

Three files — app.contract (UI), app.ts (data), and app.test.contract (all-platform test). Replace the starter files in an exact new app to run and test it on web, macOS, and iOS.

// app.contract — view, state, and actions. No colors or control sizes:
// each host renders its own heading, field, button, checkbox, and list.
shape Todo
  id: string
  title: string
  done: bool

shape Change
  count: number

component Todos
  state draft = ""
  mutation changed as shape Change refreshes todos
  resource todos = todos() as shape Todo[]
  derive left = todos.filter(t => not t.done).length

  action edit(value: string)
    draft = value
  action add
    if draft.trim() != ""
      send changed = addTodo(draft.trim())
      draft = ""
  action toggle(id: string, done: bool)
    send changed = setDone(id, done)
  action remove(id: string)
    send changed = removeTodo(id)

  view
    list appearance="auto" height="100%"
      section
        header
          text `${left} left` role="heading" testId="count"
        row
          input value=draft input=edit submit=add placeholder="What needs doing?" aria-label="New todo" testId="new-todo" flex=1 min-width=0
          button press=add buttonStyle="filled" testId="add"
            text "Add"
      section
        for t in todos key=t.id
          row delete=remove(t.id) testId=`todo-${t.id}`
            input type="checkbox" checked=t.done change=toggle(t.id) aria-label=t.title testId=`toggle-${t.id}`
            text t.title flex=1
            button press=remove(t.id) destructive=true testId=`remove-${t.id}`
              text "Delete"
// app.ts — owns the list and answers Contract's typed requests
import type { Answer, Sources } from './app.contract.d.ts';

export const grants = ''; // e.g. 'net.fetch https://api.example.com'

type Todo = { id: string; title: string; done: boolean };
let todos: Todo[] = [];
let next = 1;

const sources: Sources = {
  todos: () => todos,
  addTodo: ([title]) => {
    todos = [...todos, { id: String(next++), title, done: false }];
    return { count: todos.length };
  },
  setDone: ([id, done]) => {
    todos = todos.map((t) => (t.id === id ? { ...t, done } : t));
    return { count: todos.length };
  },
  removeTodo: ([id]) => {
    todos = todos.filter((t) => t.id !== id);
    return { count: todos.length };
  },
};

export const answer: Answer = (source, args, store, storage, native) =>
  sources[source](args, store, storage, native);
// app.test.contract — runs unchanged on every host via `exact.mjs test <host>`
test "add, finish and delete"
  expect text "count" == "0 left"
  type "new-todo" "Buy milk"
  tap "add"
  type "new-todo" "Walk the dog"
  type "new-todo" key "Enter"
  expect text "count" == "2 left"
  tap "toggle-1"
  expect text "count" == "1 left"
  tap "remove-1"
  expect tree missing "todo-1"
  expect tree has "todo-2"
WebmacOSiOS Simulator
The todo app on the web host The todo app on macOS The todo app on the iOS Simulator

The view never mutates the list directly. Actions send a typed mutation across the data seam, app.ts updates its state and returns a validated shape, and refreshes todos re-reads the list. To persist across launches, grant sqlite.open app:/data/todos.db and use storage.sqlite (see Fieldnotes).

If a source is a single HTTP request, skip app.ts altogether: declare the source in app.contract with its URL and JSON pointer, and native builds link no JavaScript engine. See the declared-source recipe and Weather Now.

Contract at a glance

Construct Purpose
shape Closed record type (number, string, bool, nested shapes, option<T>, T[]).
component UI unit (first in a file is root). Supports props, provide/inject, and slot/children.
state / derive Owned component state and reactive derived values. Under for, child state scopes to the keyed row.
resource / mutation Typed data reads (resource x = source(args) as shape T) and writes (send x = source(args) with refreshes, pending()
Live data via GitHub REST API · Cached 30 min · Created 02 Nov 2026