Get started – Kotlin
fuaran-ui (the Kotlin library) is a native Kotlin surface over the Rust reference core of the Fuaran UI wire format. The Rust core owns truth and
mutation behind a C-ABI; the Kotlin side is a render projection: a decoder
that parses the core's canonical tree JSON into native sealed types (NodeKind,
the spec data class families, TextSource, …) for Jetpack Compose rendering.
It never canonically encodes, so there is no encode leg – you decode a session's
tree and render it. The library is JVM-first; the Android leg (the Rust core's
native .so per ABI) rides the same model.
Install
dependencies {
implementation("io.fuaran:fuaran-ui:0.1.0")
}
Published to Maven Central under the io.fuaran group.
Decode a session tree
decodeNode parses a canonical Node document into the sealed model; kind is
a sealed interface you match over with when – an unmodelled $type throws a
structured FuaranDecodeException, never a silent fallback.
import fuaran.ui.*
val root: Node = decodeNode(json) // json: the canonical tree the core handed back
// root.accessibility?.role == "main"
val box = root.kind as? Box ?: return
// box.role == BoxRole.Dashboard
for (child in box.children) {
when (val k = child.kind) {
is Heading -> println("${k.level} ${k.text}") // 2, LiteralText("Channel performance")
is Markdown -> println(k.text) // LiteralText("**Hello** from a Fuaran tree.")
else -> {}
}
}
Render it
Hand the decoded Node to the Jetpack Compose renderer (the fuaran-renderer
module): its dispatch spine walks the sealed model and projects each kind into
native @Composable views, with the interaction loop routing events back through
the core.
The tree it projects
This is the canonical wire the core decodes – rendered here by the reference host, with a one-click link into the playground:
Channel performance
Hello from a Fuaran tree.
{"accessibility":{"role":"main"},"id":"root","kind":{"$type":"Box","children":[{"id":"title","kind":{"$type":"Heading","level":2,"text":"Channel performance","variant":"Standard"}},{"id":"note","kind":{"$type":"Markdown","text":"**Hello** from a Fuaran tree."}}],"layout":{"$type":"Auto"},"role":"Dashboard"}}
Next
- Drive a live session – the
FuaranSessionbinds the Rust core's C-ABI over JNI: seed a tree, apply tree-ops, and re-project, with the core owning mutation and the session confined to a single-threaded dispatcher (AutoCloseable). - On Android – the same model renders through Compose; the Rust core ships as
a per-ABI
.sobundled in the AAR. - Where the wire comes from – any codec host emits it. Author it in F#, TypeScript, Go, or Rust.
- See the component reference, the guide, and the host roster.