The Canvas host's JavaScript held the DOM key table, press/repeat and release tracking, pointer scaling, wheel units, touch-to-mouse synthesis, focus handling, clipboard, and which events to cancel. It now forwards each raw DOM event to a Zi handler (canvas_events.zi) that owns all that state and answers with flags for what the page does next. A native behavior test drives the handler through every one of those rules without a browser, and the JS budget test now bans the key table from returning. 161 lines of JavaScript are gone.
Kryon
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.
Plot lives in the optional src/plot/ package. make plot builds
build/ziran/libkryon_plot.a; apps importing plot_widget add
src/plot/ to their Ziran module paths. The kryon project command adds
this path automatically.
TableView and TreeView live in the optional src/data_views/ package.
make data-views builds build/ziran/libkryon_data_views.a; apps add that
directory to their Ziran module paths when importing either widget. The
kryon project command adds the path automatically.
KSS parsing, formatting, and installation live in the optional src/kss/
package. make kss builds build/ziran/libkryon_kss.a; the core UI library
keeps style resolution but does not import the parser. Ziran projects add the
KSS module path automatically.
The optional src/syntax/ package tokenizes Ziran, C, and Make text into
caller owned color spans for TextArea. make syntax builds
build/ziran/libkryon_syntax.a; core TextArea paints spans without importing
the tokenizer. Ziran projects add this module path automatically.
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.
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 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.
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.