A language,
from first
principles.
KataScript is a small, expression-oriented programming language.
Try a closure
Run this example, or step through it to see how each counter keeps its own state.
Walk through the project →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()}")Learn KataScript
Inside the interpreter
Kata is a personal language workbench: a Rust interpreter, a terminal REPL, and a standard library written partly in KataScript itself.
See the language status for supported features and known limits.
Look inside the repository ↗- 01SourceYour program, in a
.ksfile.let n = 42 - 02Tokens & syntaxA lexer and parser give it structure.
--dump-ast - 03ExecutionValues, scopes, and runtime checks.
42 : Int
From the Blog
Design noteUpdateDesign note
A closure keeps a binding
A small counter reveals what a function carries out of the scope where it was created.
A home for KataScript
A new place for the language guide, practical tutorials, and examples you can inspect and run.
Three ways to name a type
Why KataScript separates product types, sum types, and interfaces into kind, enum, and type.