Skip to content
kata / a language workbench

KataScript · experimental

A language,
from first
principles.

A small programming language.
An open workbench for understanding it.

Write expressions, model data, and follow an idea all the way from source to execution.

cargo run -- ks hello.ks
ON THE WORKBENCH01 / CLOSURES
counter.ks Checked with kata
func make_counter(start: Int, step: Int): Func {
let value = start
ret func(): Int {
value = value + step
ret value
}
}
let next = make_counter(0, 1)
let tens = make_counter(0, 10)
print("next: {next()}")
print("next: {next()}")
print("tens: {tens()}")
print("next: {next()}")
print("tens: {tens()}")

Two counters. Two captured values. One function.
Walk through the example →

Expression-orientedDynamic typesLexical closuresWritten in RustLanguage status ↗

A PLACE TO START

Read it. Run it. Take it apart.

Choose a path through the language.

SMALL ENOUGH TO INSPECT

The machinery
is part of the story.

Kata is a personal language workbench: a Rust interpreter, a terminal REPL, and a standard library written partly in KataScript itself.

It is experimental. The design is open, the implementation is readable, and the rough edges are documented.

Look inside the repository ↗
  1. 01
    SourceYour program, in a .ks file.
    let n = 42
  2. 02
    Tokens & syntaxA lexer and parser give it structure.
    --dump-ast
  3. 03
    ExecutionValues, scopes, and runtime checks.
    42 : Int

FROM THE WORKBENCH

Notes on a language in progress.

All writing →