Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Appendix · The Lexicon

This is the contract between xrune’s medieval vocabulary and ordinary compiler/CS terms. Every chapter reaches back here when the metaphor risks drifting from the engineering meaning.

Naming compact

xrune termPlain meaning
sigilA derive macro (xrune-sigil). The DsRef derive mints {Name}Ref newtypes around Rc<RefCell<Name>>.
nexusThe core crate (xrune-nexus) — AST node types, the DsRune trait, and the decipher walker. The hub everything else binds to.
incantThe proc-macro crate (xrune-incant) that exposes ui! { … }. The act of invoking the DSL.
runeA backend implementation of the DsRune trait — turns the parsed tree into emitted code. The DSL is one casting; runes are many translations.
decipherThe free function xrune::ds_rune::decipher::decipher(tree, &mut rune) that walks a DsTree and dispatches one inscribe call per node.
inscribeOne method on DsRuneinscribe_root / inscribe_widget / inscribe_if / inscribe_iter / inscribe_niche / inscribe_match. Each receives a node and accumulates output into the rune.
sealThe trait method seal(self) -> TokenStream. Consumes the rune at the end of decipher to produce the final emitted code. Not Rust’s “sealed trait” pattern — same name, unrelated meaning.
enchantA bracketed expression list [expr, expr, …] attached to a widget. Arbitrary data the rune can attach to a node — typically ECS components or attached state.
nicheA @name { … } node. An anchor / slot / named region routed by the host rune (e.g. portals, named ports).
walk … with …Iteration. walk iterable with var { … } is xrune’s for loop.
onAn event handler clause attached to a widget — on EventKind { … } (body form) or on EventKind(cb) (callback form).
scribeThe formatter binary xrune-fmt — re-renders DSL inside ui! { … } blocks.
grimoireThis documentation site.
codexThe version history (CHANGELOG).

DSL casting compact

FormReads as
:( ... :) (each attr on its own line)Context area. parent is required; other keys are rune-defined (world, theme, …).
Widget (k: v) { … }A widget node with named attrs and children.
Widget (Text("hi"))A widget with a positional attr. No body required.
Widget (k: v) [Comp{…}, Tag] { … }Same, with enchants between attrs and body.
if expr { … }Conditional render.
walk it with x { … }Iteration.
@slot { … }Niche (named anchor).
match e { Pat => { … } … }Pattern match across sub-trees.
Widget () {} on Tap { fire() }Form B: on after the body, attaches to the preceding sibling.
Widget () on Tap { … } { … }Form C: on between attrs and body, attaches to this widget.
on Tap(cb)Callback form. cb is the trailing arg; rune decides what it means.

Public API index

The shape every reader needs once:

CratePublic surface
xrune-sigil#[derive(DsRef)]
xrune-nexusds_node::* (the Ds* AST types) · ds_rune::DsRune trait · ds_rune::decipher::decipher · pub use xrune_sigil::DsRef
xrune-incant#[proc_macro] pub fn ui
xrunepub mod default_rune; · pub use xrune_incant::ui; · pub use xrune_nexus::*;
xrune-fmtxrune-fmt <file.rs> [--check] (binary)