Skip to content
Try Kata

Language status

KataScript is an experimental language with a Rust tree-walk interpreter and a self-hosting compiler for a defined bootstrap profile. Much of the standard library is already written in KataScript. Full-language compilation and native runtime self-hosting are still in progress.

This documentation describes the current repository implementation. Passing examples establish the behavior shown; they do not establish correctness for every combination of language features.

AreaCurrent facilities
ValuesArbitrary-precision integers, floating-point values, strings, bytes, booleans, nil, tuples, fixed-width numeric types
BindingsLexical scopes, shadowing, reassignment, runtime-checked initializers
FunctionsNamed and anonymous functions, typed parameters and returns, lexical closures, recursion
Data modelingkind products, enum sums, generic types, first-class type values
BehaviorMethods, static methods, generic implementations, interface conformance
Control flowif/elif/else, while, for, bail, cont, recursive patterns
LibrariesOpt, Res, arrays, hash maps, iterator and indexing protocols
ToolingFile execution, REPL, token/AST dumps, docstring introspection, compiler bootstrap, KBC inspection and debugging

The compiler written in KataScript rebuilds itself through three byte-identical KBC generations. The tested profile includes exact integers, strings, booleans, nil, top-level functions and recursion, lexical bindings, checked annotations, branches, loops, short-circuit operators, arrays, and tuples. KVM has explicit frames, instruction limits, and live state inspection.

Kinds, enums, closures, generic impls, module imports, pattern matching, Opt/Res, raw memory, floating-point and fixed-width numerics, and interpolation currently use the tree walker. The table above describes that broader interpreter surface. The browser playground also continues to use the tree walker.

The extensible KIR graph library runs custom dialect verifiers and lowering passes in KataScript on the seed interpreter. Integrating that library into the compiled frontend and adding a native backend are separate milestones.

Type composition. Concrete generic fields inside non-generic kinds and enums are covered by regression tests. Generic interface conformance does not fully validate interface arguments or substituted method signatures.

Binding annotations. let x: Int = 1 checks its initializer. It does not retain a constraint that prevents a later reassignment to another type.

Collection aliases. Copying an array binding shares backing storage and copies the length. In the tree walker, growing one alias can invalidate another. The compiled profile keeps shared storage alive across growth. Keep one binding responsible for an array’s growth; do not mutate a collection while traversing an iterator over it.

Mutation receivers. Direct value.field = ... and value.method() are the supported teaching patterns. Nested field assignment is unsupported, and mutation through a receiver such as parent.child.method() can silently lose its update.

Lifecycle. Generic Drop dispatch and resource lifetimes are incomplete. Do not rely on scope exit to release every resource, or build resource-owning abstractions from these examples.

Maps and numerics. Repeated map insert/delete cycles can corrupt entries. Floating-point keys have equality/hash edge cases. Mixed large-integer/float comparison and non-finite numeric conversions also have correctness gaps. The examples use string map keys and avoid deletion churn.

Host and tooling robustness. Native interpreter recursion has a recoverable depth limit, and KVM calls use an explicit frame stack. Large allocations and other feature combinations still need broader validation. REPL error recovery, Unicode completion, and diagnostic source locations have known defects.

There is no const binding, built-in range syntax, range() function, map literal, match guard, exhaustive-match checker, or general user-file module loader. The current CLI does not expose script arguments. File/network I/O, package management, and a JIT are not provided by the documented scripting interface.

The Book stays within exercised behavior. For implementation work, consult the repository’s approved decisions and active proposals; some historical examples in those documents predate the current syntax.