Skip to content
kata / a language workbench

Language guide

Start with expressions and bindings, then add functions and data models. Each chapter introduces a small set of ideas you can try in the playground, a script, or the REPL. Use Run or Debug on a KataScript example to open its editor; click a recognized token for a short explanation and reference link.

  1. Syntax and values — comments, literals, operators, and expression blocks.
  2. Bindings and scope — names, reassignment, shadowing, and destructuring.
  3. Functions and closures — parameters, returns, and captured state.
  4. Types and data — products, sums, tuples, and generics.
  5. Methods and interfaces — behavior attached to types.
  6. Control flow and patterns — decisions, loops, and matching.
  7. Strings and bytes — text, interpolation, Unicode, and binary data.
  8. Collections — arrays, maps, indexing, and iteration.
  9. Modules and errors — library imports and explicit failure.

After the guide, choose a tutorial to assemble a complete program. If you already know what you need, use the language reference for a focused lookup.

func classify(n: Int): Str {
ret if n % 2 == 0 { "even" } else { "odd" }
}
for n in [1, 2, 3] {
print("{n} is {classify(n)}")
}

This program combines a typed function, an expression-valued conditional, an array, a loop, and string interpolation. There is no import because arrays and their iterator support arrive through the prelude.

KataScript’s type annotations are runtime checks, not a separate static compilation pass. Its collections and lifetime behavior are still being developed. Keep the current limits nearby while experimenting.