Language status
KataScript is an experimental language. Its Rust tree-walk interpreter runs real programs, and much of its standard library is written in KataScript. It is not yet a production runtime or a self-hosted compiler.
This documentation describes the current repository implementation. Passing examples establish the behavior shown; they do not establish correctness for every combination of language features.
Implemented
Section titled “Implemented”| Area | Current facilities |
|---|---|
| Values | Arbitrary-precision integers, floating-point values, strings, bytes, booleans, nil, tuples, fixed-width numeric types |
| Bindings | Lexical scopes, shadowing, reassignment, runtime-checked initializers |
| Functions | Named and anonymous functions, typed parameters and returns, lexical closures, recursion |
| Data modeling | kind products, enum sums, generic types, first-class type values |
| Behavior | Methods, static methods, generic implementations, interface conformance |
| Control flow | if/elif/else, while, for, bail, cont, recursive patterns |
| Libraries | Opt, Res, arrays, hash maps, iterator and indexing protocols |
| Tooling | File execution, interactive REPL, JSON token and AST dumps |
Limits that affect ordinary programs
Section titled “Limits that affect ordinary programs”Type composition. A concrete generic field such as Opt[Int] or Arr[Int] inside a non-generic kind can currently crash the host. The analogous enum payload case is affected too. 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 does not create independent backing storage. Growing one alias can invalidate another. 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. Deep recursion can overflow the host stack. Certain large allocations and valid type combinations can panic. REPL error recovery, Unicode completion, and diagnostic source locations have known defects.
Not available yet
Section titled “Not available yet”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, a bytecode VM, and a JIT are not provided by the documented scripting interface.
The guide 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.