Hosts
Checked against 2994ef5 on 2026-11-10 by Capy (review pass: Subagent 124 and fable). The files it covers are unchanged since.
A host is the native program around a niso document: it owns the window and the display clock, runs the document’s event loop, draws the render stream with its UI toolkit and sends the user’s input back. There’s one host per UI toolkit, and each supports every platform its toolkit targets.
| Host | Toolkit | Platforms | Code |
|---|---|---|---|
| Apple | SwiftUI | iOS, iPadOS, macOS, tvOS, visionOS, watchOS; CarPlay through templates | hosts/apple |
| Android | Jetpack Compose, Material 3 | Android | hosts/android, over crates/niso-android |
| iced | iced | Linux desktop (also builds on macOS) | hosts/iced |
WinUI 3 for Windows is planned. Platforms has each host’s details.
What every host does
Section titled “What every host does”- Sets up the document: creates the DOM, sets the viewport size, measures
its native controls and reports their sizes and stock styles
(
niso_dom_set_control_size,niso_dom_set_button_style). The Apple and Android hosts also set the user’s text scale, color scheme and accent colors, publish the platform’s design tokens (niso_dom_set_platform_style), report their text fields’ style (niso_dom_set_field_style) and name the app’s origin. The iced host does only the first part: the viewport, control sizes, the control font size (niso_dom_set_control_font_size) and the stock button style. - Starts the app: evaluates the page’s JavaScript bundle, or calls an
app library’s
niso_app_main(niso_app.h). - On each display frame: runs the event loop up to now (
niso_dom_run), asks for a frame (niso_render_frame) and applies it to its views. Then it asks for changed surfaces (niso_render_surfaces) and publishes them to widgets, activities and CarPlay (Surfaces). - Sends input back: taps and pointers (
niso_dom_tap,niso_dom_pointer), keys, wheel scrolling, native scroll offsets, control and text field changes, focus. The core dispatches them as DOM events. - Follows the system (Apple and Android): when the user changes the text size, dark mode, contrast or accent color, the host updates the document’s inputs and the page restyles without a restart. The iced host doesn’t yet (System settings).
The host never lays anything out. It places each view at the frame the core gave it, and draws text from the glyph positions the core computed. That’s why the same page has the same layout everywhere, checked against Chrome (Testing).
One host, many platforms
Section titled “One host, many platforms”The Apple host is one SwiftUI app for every Apple platform. Its renderer, engine and page loading are shared; what differs lives in small shims (the toolkit’s types, screen metrics, the frame clock, input, appearance, controls), so a new platform is a branch in each shim, not a fork (The Apple host).
The Android host is an Android library (hosts/android/niso) that apps build
on, plus a host app, and calls the core over JNI. The iced host is a Rust
program on the core and QuickJS.
Headless
Section titled “Headless”niso-run and niso-node are hosts without a window: they run the event loop
on virtual time, render frames on request and tap at coordinates, which is how
niso’s own tests drive pages (Headless).