tawasuyu

tawasuyu/llimphi

Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.

Rust 238TOML 102Markdown 83Shell 24178 Sutichaykuna

⎇ main llimphi-wasm-app-sdk/README.md Markdown · 25 siq'ikuna · 1.1 KB Ñawpa willay ch'uya

chore: refresco desde el monorepo — 27 crates nuevos (anim, lottie, svg, mesh, image, layer, test, wire-view, widgets rag-sidebar/router/lazy-list/rive-button) y sync de los 95 existentes 93253cc22 · Sergio ·

1# llimphi-wasm-app-sdk
2
3The guest side of Tier 3 WASM apps.
4
5An app implements `WasmApp`: its own `Model`, an `update(&mut self, Msg)`
6transition and a `view(&self, &mut Ui) -> WireNode`. The UI is built with
7`llimphi_wire_view`'s free constructors (`col`/`row`/`text`) for the
8non-interactive parts and with the `Ui` for the interactive ones
9(`button`/`text_input`/`checkbox`).
10
11**Events with payload.** The `Ui` assigns an `EventId` to each control and stores
12its handler. The node carries only the id; on firing, the host sends
13`dispatch(event_id, payload)`. The guest looks in its table and rebuilds the
14`Msg`: a button yields its fixed `Msg`, an input yields `f(typed_text)`, a
15checkbox `f(new_state)`. That is why **`Msg` no longer crosses the boundary** —
16only the id and the `EventPayload` — so `Msg` is freed from (de)serializing:
17`Clone` is enough.
18
19`export_wasm_app!` generates the ABI: `wasm_init`, `wasm_view() -> u64`
20(ptr<<32|len of the postcard `WireNode`), `wasm_dispatch(event_id, ptr, len)`,
21`wasm_alloc`, `wasm_free`. The `Model` and the handler table live in the guest.
22
23---
24
25Part of **llimphi** — see [llimphi](../README.md).

README.md

llimphi-wasm-app-sdk

The guest side of Tier 3 WASM apps.

An app implements WasmApp: its own Model, an update(&mut self, Msg) transition and a view(&self, &mut Ui) -> WireNode. The UI is built with llimphi_wire_view's free constructors (col/row/text) for the non-interactive parts and with the Ui for the interactive ones (button/text_input/checkbox).

Events with payload. The Ui assigns an EventId to each control and stores its handler. The node carries only the id; on firing, the host sends dispatch(event_id, payload). The guest looks in its table and rebuilds the Msg: a button yields its fixed Msg, an input yields f(typed_text), a checkbox f(new_state). That is why Msg no longer crosses the boundary — only the id and the EventPayload — so Msg is freed from (de)serializing: Clone is enough.

export_wasm_app! generates the ABI: wasm_init, wasm_view() -> u64 (ptr<<32|len of the postcard WireNode), wasm_dispatch(event_id, ptr, len), wasm_alloc, wasm_free. The Model and the handler table live in the guest.


Part of llimphi — see llimphi.