boxmoe_header_banner_img

Hello! 欢迎来到阿虪的开发世界~

加载中

文章导读

Exact:Expo 的 Agent 原生跨平台运行时,一份代码跑遍 Web、macOS、iOS 与 Linux


avatar
阿虪 13 11 月, 2026 188
exact

中文版

Exact(GitHub:https://github.com/expo/exact ,2026-11-02 创建,今晨抓取时已 3,358★)是 Expo 的新项目:一个跨平台应用运行时。写一次应用,在 Web、macOS、iOS 和 Linux 上都以原生方式运行,而且 AI Agent 可以在每个平台上自己构建、运行、查看和测试它。

按 README 的介绍,你用 Contract(一门小型声明式语言)描述界面,用 TypeScript 或 Rust 写数据逻辑;Contract 编译器把界面编译成紧凑的执行计划。Web 上这份计划变成一个约 20KB 的 ES 模块,驱动真实的 DOM 与 CSS;macOS、iOS、Linux 上由 Rust runner 执行同一份计划,Rust 布局内核按 CSS 规则算好每个盒子,再由各平台自己的工具绘制:AppKit、UIKit 或 GPU 绘制器。没有 WebView、没有 JavaScript 桥,首像素出现之前不执行任何应用 JavaScript。

最特别的是“Agent 原生”:十个统一操作(tree、screenshot、tap、type、state、layout、logs、clock、prefer、perf)通过一个脚本驱动全部平台;时钟归 Agent 控制,两个操作之间时间静止,不用等动画跑完;测试就是这些操作的脚本,一份测试在任意平台上原样运行。速度预算也很激进:冷启动到可交互首帧 100 毫秒、改一行代码到呈现 100 毫秒。MIT 开源。

需要注意:项目明确标注 pre-1.0,每天都在变,没有 API 稳定性、不保证向后兼容、没有迁移指南。

为什么值得了解

  • 写一次、跑四端,而且是真原生:Web 用真实 DOM,macOS/iOS 用 AppKit/UIKit 控件,不是套壳 WebView
  • 为 Agent 而生:Agent 能自己建应用、自己跑、自己截图看效果、自己测——对“让 Agent 写应用”这件事,它把反馈闭环做进了运行时
  • 对 iOS/Mac 开发者尤其值得看:Expo 团队操刀,布局就是 CSS、控件就是系统原生,思路可以直接借鉴到自己的跨端方案里
  • 速度目标很实在:首帧 100 毫秒、改动 100 毫秒呈现,性能预算写进规则、每次提交都跟踪

English Version

Exact (GitHub: https://github.com/expo/exact , created 2026-11-02, 3,358 stars at this morning’s fetch) is a new project from Expo: a cross-platform application runtime. Write an app once and it runs natively on the web, macOS, iOS and Linux — and an AI agent can build it, run it, look at it and test it on every one of them.

Per the README, you describe the interface in Contract, a small declarative language, and write the data logic in TypeScript or Rust; the Contract compiler turns the interface into a compact plan. On the web that plan becomes a ~20 KB ES module driving the real DOM and CSS; 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, and no app JavaScript runs before the first pixel.

The standout idea is “agent native”: ten uniform operations (tree, screenshot, tap, type, state, layout, logs, clock, prefer, perf) drive every host through one script; the clock belongs to the agent, so nothing moves between two operations and there is no waiting for animations; tests are scripts of those operations, and one test file runs unchanged on any host. The speed budgets are aggressive too: cold start to interactive first frame in 100 ms, an edit to presented in 100 ms. MIT-licensed.

One caveat: the project is explicitly pre-1.0 and changes daily — no API stability, no backwards compatibility and no migration guide, by design.

Why it’s worth knowing

  • Write once, run on four platforms, and genuinely native: the web uses the real DOM, macOS and iOS use AppKit/UIKit controls — not a webview shell
  • Built for agents: an agent can build an app, run it, screenshot it, and test it by itself — the feedback loop for “let the agent write apps” is built into the runtime
  • Especially worth a look for iOS/Mac developers: from the Expo team, layout is CSS and controls are the system’s own — ideas you can borrow for your own cross-platform approach
  • The speed targets are concrete: 100 ms to first frame, 100 ms from edit to presented, with budgets tracked on every commit


评论(0)

查看评论列表

暂无评论


发表评论

表情 颜文字

插入代码