A tour of Weaver
This tour teaches Weaver through small programs, each of which you can
copy into main.wft and run with wv run main.wft. Every program on
these pages is compiled and run by the site’s own checks, so what you read
is what the compiler accepts today.
It assumes you know another language: Weaver borrows from Rust, Swift, Scala, Go and TypeScript, and the tour says where it differs from them.
- Values and functions: bindings, numbers, strings, functions and how to call them.
- Records, enums and optionals: the data a program is
made of, and the absence of
null. - Control flow and patterns:
if,match, loops and ranges. - Collections and sequences: arrays, maps, lambdas and lazy sequences.
- Errors:
T ! E,!andcatch, instead of exceptions. - Contracts and generics: what a type promises, and code written once for many types.
- Values, mutation and resources: how Weaver manages
memory without a garbage collector, and what
usingguarantees. - Understanding memory: where a value lives, who owns it and when it is freed, in diagrams.
- Tasks and concurrency: tasks, promises the compiler will not let you forget, cancellation, channels and shared state.
- Code that runs at compile time: annotations,
metacode and quotes. - Comments and documentation: doc comments the
compiler checks, examples that are tests, and
wv doc. - Extensions: code compiled apart, that a program loads and reloads while it runs.
When you need the exact rule rather than an introduction, the language reference has it; the guides cover the standard library, files, processes, HTTP, tasks and time.