Get Started
MBUI ARCHITECTURE

One retained tree from MoonBit to GPU.

No virtual DOM, no WebView — one tree, six GPUs.

mbui · render pipeline Click a stage
macOSMetal
iOSMetal
AndroidOpenGL ES
WindowsD3D11
LinuxOpenGL
WebWebGL 2
@signals Equal writes stop here — T : Eq short-circuits. 0 WebView · 0 JS bridge
SIGNALS & LAYOUT

Build once. Update only what changed.

Equal values stop at the signal; only the bound leaf repaints.

Signal[T] View::by_room View::scrolls_window
counter_badge.mbt
let unread = @signals.signal(3)
let label  = @signals.computed(fn(_) { "\{unread.get()} unread" })
row.words_runs(By(fn() { runs(label.get()) }))
unread.set(3)
Signal[Int] unread = 3
Computed[String] idle
View::words_runs idle
Toolbarskipped
Sidebarskipped
ScrollListskipped
0 virtual DOM allocations Click unread.set(+1)
CLOSED-FORM MOTION

Motion as data, never frame loops.

Springs are functions of time: interrupt anytime, velocity carries over.

NodeWay · spring
x(t)
Original Retargeted
1.0 0.3 0.0 0ms 500ms target A target B 140ms v(t₀)
Retargett₀ = 140ms
x(t₀)—
v(t₀)—
Δv jump0.00/s
Settles—
let way = @motion.NodeWay::new(0.0)
way.go(v, 1.0, @motion.spring())
way.go(v, 0.3, @motion.spring()) // keeps v(t₀)
ComeGroup NodeWay::motion 0 idle wakeups
6 GPU BACKENDS

One display list. Six native GPUs.

Thin native hosts, native text and IME, one shared display list.

macOS

Metal

AppKit, CoreText, offscreen Metal capture.

iOS

Metal

UIKit touch, safe areas, native keyboard.

Android

OpenGL ES

JNI host driving OpenGL ES directly.

Windows

Direct3D 11

Win32, DirectWrite, DPI-aware windows.

Linux

OpenGL

GTK 4 on Wayland, X11, headless CI.

Web

WebGL 2

Canvas WebGL 2 for docs and Storybook.

@hostapi boundary

Every OS call crosses one trait; tests swap in FakeHost.

App & @view MoonBit
@hostapi · Host one boundary
src/host/* 6 GPU hosts
FakeHost headless CI

mbui-runtime

Rebuild only the .wasm; a prebuilt Wasmtime shell runs it.

Full native build C · Xcode · NDK
.wasm → Wasmtime seconds
DETERMINISTIC TESTER

Time is declared, never waited for.

Script input, declare time, get identical pixels at every frame rate.

contract.drive
01tapxy 180 64
02drag 240 420 240 160
03run_for 320ms
04audit --strict
05picture out.webp
120 fpssha256:9f4c…a81e—
60 fpssha256:9f4c…a81e—
24 fpssha256:9f4c…a81e—
7 fpssha256:9f4c…a81e—
audit(): — IDLE

See the engine running live.