<!-- Tour · Tin · https://tin.ad/docs/tour/ · generated from the built page -->

# A tour of Tin

Eight short chapters for people who already program. Every code block is a real file from `examples/`,
and every output is what the test suite checks.

Coming from Python or TypeScript? Read [the side-by-side](https://tin.ad/docs/from/). Want it slowly, with tasks? [Learn Tin](https://tin.ad/docs/learn/).

- [1Hello, TinA program is a file with a `main`. Strings interpolate, and everything is an expression.](https://tin.ad/docs/tour/hello/)
- [2Structs and sum typesData is described with `type`. A sum type lists every shape a value can take, and `match` must handle all of them. Every value is copied, never shared.](https://tin.ad/docs/tour/types/)
- [3No null, no exceptionsA value that may be missing is an `Option`. An operation that may fail returns a `Result`. `?` passes the failure up.](https://tin.ad/docs/tour/errors/)
- [4Functions, pipelines and closures`x |> f(y)` means `f(x, y)`, and so does `x.f(y)`. Use whichever reads better.](https://tin.ad/docs/tour/functions/)
- [5GenericsGeneric code is specialised at compile time. `Stack<int>` and `Stack<string>` become separate WebAssembly functions.](https://tin.ad/docs/tour/generics/)
- [6Concurrency without coloursThere is no `async` keyword. Any function can suspend, and callers don’t have to know. `spawn` starts a task, `await` waits for it, and no task outlives its parent.](https://tin.ad/docs/tour/concurrency/)
- [7Tools and agentsA `tool fn` is a function the compiler also describes to a model. An `agent` is called like a function.](https://tin.ad/docs/tour/agents/)
- [8Guarded tools and teamsPut a human in the loop with one word. Compose agents with the tools you already know: sub-agents, `spawn` and `|>`.](https://tin.ad/docs/tour/teams/)
