KRYON

The Network-Native UI Cartridge System

Define UIs in .kry • Compile to .krb • Control via CoAP

What is Kryon?

Kryon is a UI cartridge system — portable bytecode for user interfaces. Write UI definitions in a path-based VFS language, compile to portable bytecode, and control properties over the network via CoAP.

A single .krb file runs on ESP32, Plan 9, Linux, Android, and in the browser. Control your entire UI through simple file operations on network paths.

📝

Path-Based VFS

Every value is a file path

📦

Portable Bytecode

Compile to .krb, run anywhere

🌐

Network-Native

Control via CoAP, HTTP, MQTT

Minimal

Under 1KB for typical UIs

Philosophy

  • Everything is a file — UI properties exposed as VFS paths like /0/radius, /env/w
  • Path-based by design — All access through absolute (/dev/draw), relative (./value), and parent (../speed) paths
  • Network-native by design — CoAP for lightweight, constrained-device control
  • Cross-platform runtime — Single .krb runs everywhere with the krbdraw engine

The .kry Language

A path-based, VFS-oriented language for defining UIs with events and animations.

const meta {
    title "Inner Breeze"
    ver   "alpha"
}

var env {
    w 200
    h 400
}

def circle {
    write /dev/draw [ circ %center[0] %center[1] ./radius %color ]
    %logic
}

circle {
    center [ 100 100 ]
    radius 50
    color 0xFF0000

    logic {
        listen /dev/timer {
            tick 50 {
                write ./radius [ + ./radius ./dir ]
            }
        }
    }
}

Language Features

  • const — Compile-time constants (metadata, sprites)
  • var — Runtime mutable variables
  • def — Creates VFS instances (numbered folders)
  • fn — Inline helpers (no VFS created)

Paths

  • Absolute: /dev/draw, /env/w, /meta/title
  • Relative: ./radius, ./color
  • Parent: ../speed, ../size
Full Language Reference →

VFS System

UI properties are exposed as network-accessible file paths. const blocks create read-only paths, var blocks create read-write paths, def creates numbered instance folders.

const meta {
    title "MyApp"        // /meta/title (read-only)
}

var env {
    w 200                // /env/w (read-write)
    h 400                // /env/h (read-write)
}

def button { ... }

button { ... }      // Creates /0
button { ... }      // Creates /1
VFS Documentation →

Binary Format (.krb)

The .krb format is a compact bytecode representation of your UI. Compiled by kry2krb, executed by krbdraw. Typical UIs are under 1KB.

Full Format Spec →

CoAP Protocol

CoAP (Constrained Application Protocol) is the default network protocol for Kryon. Designed for constrained devices like ESP32, it offers UDP-based lightweight communication with REST-like semantics.

Example Usage

# Read value
coap-client get coap://192.168.1.100/0/radius

# Set value to 100
echo -n -e "\x00\x64" | coap-client put coap://192.168.1.100/0/radius
CoAP Protocol Reference →

Platform Implementations

ESP32 kryesp

Native ESP-IDF implementation with ILI9341 LCD support, CoAP server via libcoap, WiFi connectivity, and FreeRTOS threading.

  • ESP32-S3, ESP32-C3 supported
  • SPI LCD (ILI9341)
  • CoAP server on port 5683
ESP32 Guide →

Plan 9 krysrv

Native Plan 9 port with CoAP to 9P bridge. Mount at /mnt/kry for filesystem-based control.

  • CoAP ↔ 9P translation
  • Mount at /mnt/kry
  • Graphics via draw(3)

Linux plan9port

Runs via plan9port with CoAP server for network control. X11 or framebuffer graphics.

  • VFS at /tmp/kry
  • X11 or framebuffer
  • CoAP server included

Web kryweb

WebAssembly build of krbdraw with CoAP over WebSocket. Live editor for .kry files with browser-based preview.

  • WASM runtime
  • CoAP over WebSocket
  • Live .kry editor
Work in progress

Android krydroid

Native Android implementation using JNI with Kotlin/Java bindings. Canvas-based rendering with CoAP network control.

  • JNI C runtime bridge
  • Canvas/SurfaceView rendering
  • CoAP client/server support
Work in progress

Getting Started

1. Write a UI

Create a file named example.kry:

const meta {
    title "Demo"
}

var env {
    w 200
    h 300
}

def window {
    write /dev/wctl [ new 0 0 %size[0] %size[1] %title ]
}

def circle {
    write /dev/draw [ circ %center[0] %center[1] ./radius %color ]
}

window {
    title /meta/title
    size [ /env/w /env/h ]

    circle {
        center [ 100 150 ]
        radius 50
        color 0xFF0000
    }
}

2. Compile

kry2krb example.kry -o example.krb

3. Run

krbdraw example.krb

4. Control over Network

coap-client get coap://esp32.local/0/radius
echo -n -e "\x00\x64" | coap-client put coap://esp32.local/0/radius

Install Dependencies

Nix
nix-shell or nix develop (flakes)
Plan 9
mk install
Linux
make install
ESP32
idf.py build

Community

Join the Kryon community to ask questions, share projects, and stay updated.

Creator

Waozi

Waozi

Website | Twitter

Sponsors

5bitcube Logo

5bitcube

Website | Twitter