Tutorials
Each tutorial ends with a complete editable program, its checked output, and a source download. Choose Run to try your changes in the browser, or Debug to follow statement checkpoints. You can also run locally from the repository root with cargo run -- ks site/examples/NAME.ks.
Count words
Section titled “Count words”Turn text into a frequency table with string normalization, arrays, a map, and explicit defaults for missing keys. This is a first program to try after the getting-started page.
You will learn how data moves between library types and why output ordering should be a deliberate choice.
Keep state in a closure
Section titled “Keep state in a closure”Build independent counters from one factory function. Follow the difference between creating a binding and updating a binding, then see why two returned functions can have separate state.
You will learn how lexical capture works without introducing an object or global counter.
Design a result-returning API
Section titled “Design a result-returning API”Divide a quantity among teams and people while making invalid inputs explicit. Define the operation’s contract, represent failure as data, propagate it through a second function, and render it at the boundary.
You will learn how Res, match, and ? fit together.
For shorter programs with less explanation, browse the example collection.