XRack
GitHub

XRack

A declarative framework for native desktop UI

Compose your interface in .xr and write app logic in Rust or Python.

Compose interfaces from components

Combine text, buttons, and layouts in a component. Bindings connect values, and callbacks handle user actions.

counter.xr Browser demo
export component Counter inherits Window {
  in-out property <int> count: 0;
  VerticalLayout {
    Text { text: "Count: " + root.count; }
    Text { text: "Doubled: " + root.count * 2; }
    increment := Button {
      text: "Increment";
      clicked => { root.count += 1; }
    }
  }
}
Counter
Count 0

Doubled0

Click Increment to see both text bindings update.

Browse all built-in controls
XRack Live Preview showing a counter in VS Code
XRack Live Preview in VS Code

Editor workflow

See changes as you edit.

Open an .xr file to preview and interact with a component. For apps running in live-reload mode, attach to inspect the component tree, read property values, or pick a control in its native window.

Install the VS Code extension

Compiler & runtime

One interface, two execution paths.

The compiler lowers .xr into a typed xr dialect. The optimized MLIR can run interactively or be compiled to Rust ahead of time.

.xrComponents, properties, callbacks
xr MLIRVerification and UI optimizations
InterpreterLive preview and dynamic loading
Rust AOTGenerated source for your application
Explore compilation and rendering

Get started

Open your first native window.

With Bazel or Bazelisk and JDK 17+, run the counter from the repository. For an existing Rust app, follow the Cargo guide.

macOSLinuxWindows

Counter example
git clone https://github.com/smallsunsun1/xrack.git
cd xrack
bazel run //examples/counter:counter