Skip to content
kata / a language workbench

Use the playground

Open the playground to try KataScript without installing the CLI. Interactive examples also let you edit their starting programs in place. Syntax highlighting helps separate keywords, values, comments, and operators while you work.

Edit the source, then choose Run. The interpreter executes in a WebAssembly worker and displays what the program prints. Each run starts a fresh program state; use print(...) to inspect a result.

let total = 0
for n in [2, 3, 5] {
total = total + n
print(total)
}

This program prints 2, 5, and 10 on separate lines. Change one array element and run it again to see how the accumulated total changes. A parse or runtime error appears with the run’s diagnostic output.

Choose Debug to inspect checkpoints immediately before user statements execute. Step into user functions and watch the highlighted source location, output, local bindings with their types, and call stack. Standard-library statements are hidden. A checkpoint is a statement boundary; it is not a machine instruction or a pause at every subexpression.

With the program above, follow the assignment to total through each loop iteration. At an assignment’s checkpoint, locals still show the values before that assignment. Step forward to observe its effect.

Set line breakpoints to choose where Continue stops after the current checkpoint. Step back to inspect an earlier point. The debugger reaches checkpoints by deterministically replaying the program in a fresh interpreter, rather than resuming a suspended process. Its output panel is replaced with the output prefix captured at the selected checkpoint, so stepping back also moves output back.

Stop ends an active execution. Reset restores the editor’s starting program so you can repeat the original example. Runs have a limited execution budget; keep loops, recursion, output, and allocation small. A budget limit is a signal to reduce the experiment, not evidence that the program completed.

For longer investigations, download or copy the source and use the local CLI. The browser does not provide arbitrary local-file imports, network APIs, a package manager, or server-side tooling.

Click a recognized token in the editor, or move the cursor onto it, to see a short explanation. Follow its reference link for syntax, contracts, and a fuller example. Try let, for, Int, print, or + in a small program.

Help is based on the token’s spelling. It does not infer that an arbitrary receiver is an array or a map: get, len, and new can mean different things on different types. The language reference provides the distinctions.

The examples gallery starts from programs with source files and checked expected output in the repository. Running an edited program produces a new result; it does not change the original expected-output record. The original source and recorded syntax tree provide a baseline for comparison.

Continue with syntax and values, build a tutorial, or explore the example gallery.