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.