Introduction
Kura is a purely functional language for describing user interfaces, with explicit, compiler-driven reactivity. It compiles UI descriptions into native code that a host application (a game engine, a custom renderer) calls every frame.
Kura aims to be:
- practical for real-time engines
- lightweight enough for native engines
- expressive like Typst
- composable like Haskell
- safe like Elm
What Kura is
Section titled “What Kura is”A language for UI composition. You describe what the UI looks like for a given piece of state, and the compiler works out how to lay it out, when it needs to change, and which render calls to emit.
What Kura is not
Section titled “What Kura is not”- A general-purpose systems language
- A scripting language for game logic
- An ECS framework
- A browser runtime
Kura sits next to your game logic. Your engine owns the window, the GPU and the game state; Kura owns the UI.
How it works
Section titled “How it works”type State = { count: Int }type Message = Click
fn init(): State => { count: 0 }
fn update(msg: Message, state: State): State => match msg { Click => { count: state.count + 1 }, }
fn view(state: State): Content => #button(on-click: Click) { #text("Clicked") #text(state.count) }- You write one or more
.kuifiles, each describing a single UI or UI element (a HUD health bar, a minimap, an inventory bar). kuraccompiles them to an object file or library, plus a C header.- Your host links the result, creates the UI, sends it Messages (clicks, ticks, anything your game wants), and asks it to update and render each frame.
Because the compiler does most of the work, the runtime stays small. view doesn’t build a
tree of objects at run time: it compiles down to a linear sequence of render calls.
Influences
Section titled “Influences”| Influence | Contribution |
|---|---|
| Elm | Predictable UI state model |
| Haskell | Functional composition and purity |
| Typst | Expressive declarative syntax |
| React | Declarative UI structure and diffing concepts |
| ImGui | Immediate, low-overhead UI interaction patterns |
Next steps
Section titled “Next steps”- Getting Started: compile your first UI
- The MVU Model: how state, messages and views fit together
- Language Reference