waozi 2d40d0c70b Rasterize icons at the host's screen pixels
Icons were rasterized at their layout size and then scaled with the frame,
so at phone density or desktop zoom they looked blocky. A host that scales
the frame now reports its pixel scale (SetPaintPixelScale; the raylib host
does so with its zoom), and PaintSvgIcon rasterizes at that resolution, up
to 96 pixels across. tests/ziran_svg_icon_scale_test.sh checks the finer
cells on the portable VM and C.
2026-10-10 15:51:14 -03:00
2026-09-29 20:57:14 -03:00
2026-09-29 20:56:26 -03:00
2026-07-11 22:37:50 -03:00
2026-09-28 18:45:24 -03:00
2026-06-09 21:30:17 -03:00

Kryon

Linux desktop and portable hosts can decode local videos with synchronized audio using the optional GStreamer service exported as kryon/Video and kryon/VideoLinux. Display the returned frame with Image(ImageProps). Applications own playback controls and access checks; an optional expiring lease revokes both audio and decoded frames when authorization is no longer renewed. make video-test checks synthetic moving frames, paused seeking, speed, volume, replay and lease revocation with a silent audio sink and no display access.

Kryon is a UI library written in Ziran. Its source lives under src/ui/ and imports Ziran modules normally. The Ziran compiler, .zir representation, and .zib bundle format belong to the separate Ziran repository. Kryon has no .kry runtime or language compiler.

Build

For a fresh clone, place Ziran next to Kryon:

git clone https://github.com/ziranlang/ziran.git ../ziran
make
make test

make checks the modules listed in src/ui/modules.txt, writes checked .zir, generates C, C++, and Go, and compiles the native outputs from Ziran source. The current C archive is build/ziran/libkryon.a; C headers are generated from Ziran declarations into build/ziran/c/. Kryon has no handwritten source headers. Hosts provide declared effects such as raster lines, and CompositionQueue carries raw IME events to the checked text widgets.

Charts, tables, trees, and source coloring are separate Git packages that depend on Kryon: Plot, DataViews (TableView and TreeView), and Syntax. Add one with ziran add URL and import it as plot/Plot, data_views/TableView, or syntax/Syntax. Kryon exports the building blocks such packages draw with (session, tree, surface, paint_queue, style, and the others listed in ziran.toml); see writing a widget package.

Style sheets are the separate KSS package: it parses and formats .kss text, installs the rules, and ships the classic, lightfield, and material style packs. Kryon keeps the rule table and style resolution, so an app that builds its rules in code needs no parser.

The optional Game2D Ziran package owns the raylib game API. Kryon keeps its geometry, drawing values, UI primitives, and raylib UI host. Kryon exports geometry and drawing_props so Game2D can share their types without pulling in widget modules. The raylib game adapter uses a C ABI and does not support native Go.

make test builds the test host and runs the Ziran source, saved-IR, and portable bundle tests with four concurrent jobs. Set TEST_JOBS=1 to run them serially or TEST_JOBS=8 on a larger machine. For a quick edit loop, use make test-focus TEST=link_widget; the filter matches test script names and skips the full library rebuild. Test subprocesses have no display access. TAIJI_DIR=/path/to/taiji make pixmap-surface-plan9-test also runs the pixel oracle through native Plan 9 8c/8l, from source and saved IR, in a private headless guest. Its build uses 512 MiB and allows 900 seconds; override those with KRYON_PLAN9_MEMORY and KRYON_PLAN9_TIMEOUT when needed. make sanitize-test runs the behavior tests with AddressSanitizer and UndefinedBehaviorSanitizer. Keep one-off experiments in build/scratch/; make clean-scratch removes that and any other build/ entry that no target writes, once it has been idle for a day. See composition input for the checked IME event contract and host queue lifetime. See cursor input for the checked cursor decision and platform effect contract. See style picker for caller-owned pack selection. See zoom for Ctrl and mouse-wheel zoom of a whole application. See clipboard state for the portable clipboard value and host effect contract. See frame replay for committed UI and paint capture with scripted input on a headless host. The Ziran example builds a .zib that imports Kryon and runs a retained Button press and release through a separate Ziran SVG host without a display. The same directory also has a plain Text(TextProps) hello world desktop example; make -C examples desktop-text-test renders it on a private display. For Ziran app manifests, the terminal backend, and kryon run, see Ziran projects. Portable desktop profiles build a .zib with embedded assets; a downloaded file launches with kryon run app.zib. See Zib applications.

Current status

The feature matrix records package and host coverage. The Canvas2D browser host is covered by private headless Chromium, WebAudio, and Wasm tests. Its semantic DOM profile is covered by a separate private headless Chromium document test. The open-work plan lists the remaining platform-accessibility work.

Downstream applications migrate their own sources and platform hosts at their own pace. Kryon commits land upstream first; apps then move only their clean vendor/kryon submodule pointer. This repository's tests verify Kryon itself, not every downstream application build.

See docs/ARCHITECTURE.md for the library boundary and Ziran's implementation status for language and portable runtime gaps.

S
Description
Toolkit for visual and agent-assisted development of cross-platform apps.
https://kryonlabs.com Readme BSD-3-Clause
307 MiB
0 Stars 1 Watchers 0 Forks
Languages
Ziran 83.1%
Python 9.9%
Shell 4.2%
Makefile 0.8%
TypeScript 0.7%
Other 1.2%