Skip to content

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

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.

  • 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.

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)
}
  1. You write one or more .kui files, each describing a single UI or UI element (a HUD health bar, a minimap, an inventory bar).
  2. kurac compiles them to an object file or library, plus a C header.
  3. 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.

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