A SwiftUI + Rust shell for .crepus templates — build native iOS/macOS apps with a Tailwind-inspired template syntax.
Aurorality combines:
.crepustemplates — Tailwind-inspired declarative syntax that compiles to SwiftUI. From crepuscularity.- Rust rendering backend — Parses templates + manages plugin logic via UniFFI
- SwiftUI renderer — Reactive view tree from the IR with hot reload support
div flex flex-col gap-6 p-8
span text-3xl font-bold
"Hello from aurorality"
span text-base
"Edit this file and watch SwiftUI update live."
aurorality/
├── crates/
│ ├── aurorality-core/ # UniFFI bridge, render API, plugins
│ ├── aurorality-cli/ # Dev server, build, scaffold
│ └── aurorality-macros/
├── swift/Sources/Aurorality/
│ ├── IR.swift # ViewIr, ViewNode, ViewStyle
│ ├── AurorView.swift # SwiftUI renderer
│ ├── AurorState.swift # State management
│ ├── AurorBridge.swift # Plugin calls
│ ├── HotReloadClient.swift
│ ├── HotReloadBus.swift / HotReloadHUD.swift / AurorDevOverlay.swift
│ └── TransportTypes.swift
└── examples/
├── basic/
├── counter/
├── hyperchat/
└── textanalyzer/
# Build the Rust core with JavaScript plugin support
cargo build -p aurorality-core --features js
# Generate eqswift/UniFFI Swift bindings
cargo run -p aurorality-core --features js --bin uniffi-bindgen generate \
--library target/debug/libaurorality_core.dylib \
--language swift --out-dir generated
cp generated/aurorality_coreFFI.modulemap generated/module.modulemap
# Run dev server
cargo run -p aurorality-cli -- dev examples/basic
# Or open in Xcode
open examples/basic/Aurorality.xcodeproj.crepus files use a Lisp-like indentation syntax with Tailwind classes:
div.flex.flex-col.gap-4.p-8
span.text-2xl.font-bold
"Hello, {name}!"
button.rounded.bg-blue-500
"Click me"
| Element | Description |
|---|---|
div |
Stack container (VStack/HStack based on axis) |
span |
Text node |
button |
Tappable button |
image |
AsyncImage or bundled asset |
scroll |
ScrollView wrapper |
slotRotate |
Timed phrase rotation |
See crepuscularity-native/src/ir.rs for the full ViewStyle schema.
p-[1-96],px-,py-,pt-,pb-,pl-,pr-m-[1-96],mx-,my-,mt-,mb-,ml-,mr-
w-[1-96],w-full,w-screen,w-fit,w-1/2,w-1/3h-[1-96],h-full,h-screen,h-fitmin-w-[ ],max-w-[ ],min-h-[ ],max-h-[ ]size-[ ],aspect-square,aspect-videowidthFraction,heightFraction
text-[xs|sm|base|lg...|9xl]font-[thin|extralight|light|normal|medium|semibold|bold|extrabold|black]font-[sans|serif|mono]text-align,leading-[ ],tracking-[ ]uppercase,lowercase,capitalizeitalic,underline,line-through
text-[named|hex],bg-[named|hex]- Tailwind palette:
text-red-500,bg-blue-300/50
border-[0|2|4|8],rounded-[none|sm|md|lg|xl|2xl|3xl|full]
opacity-[0-100],hidden,invisible,overflow-hidden
flex-[1|auto|none],flex-wrap,flex-nowrapgrow,shrink,items-[start|center|end|stretch|baseline]justify-[start|center|end|between|around|evenly]
Built-in Rust plugins accessible via AurorBridge:
ping→{ pong: true }echo(payload)→ echo backtimestamp→{ unixMs, unixNs }randomU32(max?)→{ value }
version→{ aurority }platform→{ os, arch }
analyze(text)→{ wordCount, charCount, lineCount, topWord, topWordCount }tokenize(text)→{ tokens: [] }
Each example demonstrates the three backend styles together:
- Rust: built-in framework plugins exposed through eqswift/UniFFI (
app,core,stats), plus example-local Rust crates where the app needs domain logic - JavaScript: JavaScriptCore plugins loaded from each example's
scripts/backend.js - Swift: app-local plugins for UI state and persistence
examples/hyperchat is the larger chat prototype. Its chat routing lives in examples/hyperchat/rust-backend, an eqswift-backed Rust crate, while Swift owns local chat state and JavaScript scores draft routing. It combines Bitchat-style nearby mesh, Matrix federation, ../stalwart-lite self-hosted archive semantics, and direct P2P routing into one optimized local chat surface.
aurorality dev watches .crepus files and pushes updates over WebSocket:
DevHelloon connect — session id, roots, optional swiftgen paths.- IR reload / patches — unless
--no-ir: full IR plus incrementalIrMutationops (replaceRoot,replaceNode, …). SwiftgenStatus— when--swiftgen-view/--swiftgen-outare set, each save re-runsswiftgenand reports ok/errors + output path.
Swift hosts use HotReloadClient → HotReloadBus and optional AurorDevOverlay (AURORALITY_DEV=1 or .environment(\.aurorDevEnabled, true)) for a corner HUD + live IR toggle.
aurorality-core exposes aurorStoreGet / aurorStoreSet / aurorStorePath (JSON blob under ~/Library/Application Support/<bundle_id>/aurorality-store.json) for lightweight app state — used by examples like HyperChat for transcripts/settings snapshots.
crepuscularity-native— IR + template parsingcrepuscularity-core— context + evaluationeqswift/uniffi— Rust ↔ Swift FFI
MPL-2.0