Skip to content
kata / a language workbench

Getting started

To try the language immediately, open the browser playground. Its controls guide explains Run, Debug, and token help. For the local interpreter and REPL, build Kata from a source checkout with Rust and Cargo installed. The commands below run from the repository root.

Terminal window
git clone https://github.com/alkemdotdev/kata.git
cd kata
cargo build

The executable is target/debug/kata. You can also run it through Cargo; the -- separates Cargo’s arguments from Kata’s arguments.

Save this as hello.ks:

let name = "world"
print("hello, {name}")
func double(n: Int): Int {
ret n * 2
}
print(double(21))

Run it:

Terminal window
cargo run -- ks hello.ks

The program prints:

hello, world
42

let introduces a binding. Double-quoted strings evaluate expressions inside braces. func defines a function, and ret returns its result. The Int annotations are checked when the program runs.

Terminal window
cargo run -- repl

Try entering these lines one at a time:

let score = 20
score = score + 1
score * 2

The REPL retains bindings between submissions and displays expression results. Tab opens completion; Ctrl+C cancels the current input; Ctrl+D exits. For longer experiments, a .ks file makes the program easy to rerun. See the REPL caveats if input or error recovery behaves unexpectedly.

The documentation’s examples live in the same checkout:

Terminal window
cargo run -- ks site/examples/fibonacci.ks

Read the Fibonacci walkthrough, then continue with syntax and values.

The standard library is embedded when Kata is built. Changes to std/ need a rebuild; you do not need a separate library installation to run the executable.