Scheme+GPUI scriptable native rust UI framework with hot-reloading
README.md

slag #

A Steel (Scheme) component framework for gpui + gpui-component. Screens are .scm files that build a plain-data element tree; slag decodes it once per frame into real gpui elements. Saving a file hot-reloads in ~10 ms.

(require "slag/ui.scm")
(require-builtin hello/host)

(provide render init)

(define (init) (state-set! 'count 0))

(define (render)
  (v-flex #:gap 8 #:p 16
    (text "Hello from slag" #:size 'lg)
    (text (number->string (state-ref 'count)))
    (button 'bump #:label "Bump"
            #:on-click (lambda () (state-set! 'count (+ 1 (state-ref 'count)))))))

examples/hello is the full wiring — host module, runtime, config, component, shell — in ~60 lines of Rust.

  • slag-core — gpui-free: element model, sandboxed Steel runtime, host registry, effects, packs, fixtures. Tests run headless.
  • slag-gpui — the gpui layer: component entity, materializer, string-keyed screen shell, hot reload.

Build notes for consumers (this workspace demonstrates all three):

  • Declare gpui deps as unpinned zed git URLs so cargo unifies them with gpui-component's, and pin the rev in your lockfile (match this repo's).
  • On Windows, carry the [patch] for vendor/gpui_windows and -C link-arg=/STACK:16777216 in .cargo/config.toml.