The language and its standard library, in the order they make sense to learn.
The tour teaches sysl in one pass, from print to a program that reads its input and reports what
it found. It assumes you already program in some language and have used one with static types. It
does not assume you have used a systems language.
Every program on these pages runs. The test suite compiles each one and checks it against the
output printed beneath it, so the pages always match the compiler. Paste any of them into a file and
run it with sysl run <file>.sysl.
A sysl block with an output block under it is a complete program, and the output block is what
it prints. A sysl block with an error block under it is a program the compiler rejects, and the
error block is the diagnostic it reports; the tour shows these because knowing what is refused is as
useful as knowing what is accepted. An output trap block is a program that prints that output and
then stops on a trap. A sysl block on its own is a fragment, quoted to show a
shape rather than to be run.
The order is deliberate. The three memory modes come about a third of the way in, before generics and
traits, because they are what most distinguishes sysl from other languages, and the pages after them
are easier to follow once you know which mode a type uses.
Pages
Values and bindings— Three ways to name a value, a scalar family with no surprises in it, and why nothing widens on its own.
Control flow— Every construct yields a value, including the loops.
Functions— An expression after `=`, or an indented block. Defaults, names at the call, and closures.
Structs and methods— Data with a name, then behaviour beside it — and a receiver that says how the method takes the instance.
Memory— Three modes, chosen per declaration. No garbage collector, no borrow checker, and no allocation keyword.
Arrays and slices— One type for storage, one for a view of it — and every index checked.
Strings— An immutable, validated `[]u8` — the same three words, with a guarantee added and an operation taken away.
Enums and patterns— A named set of constants, or a closed set of shapes — and the one expression that takes either apart.
Error handling— Two channels — a failure you handle is a value, and a bug stops the program.
Traits and generics— One mechanism for polymorphism, two ways to spend it — a bound for static dispatch, a sigil for dynamic.
Modules and the library— A module is a directory, an import only shortens a name you could always write in full, and the standard library is one auto-imported module with ten submodules under it.
Contracts and constrained types— A type that carries a rule, a struct that keeps one, and a function that states what it requires.
A program that reads its input— The whole tour at once — a trait implemented, a cursor walked, and one line to swap the source.