Cookbook
Short complete programs, each solving one practical task. All blocks with an "Output" box are compiled and run on every
site build, so the code always matches the current compiler. You can copy a program into a file and run it:
oxl run recipe.oxl (test recipes: oxl test recipe.oxl).
Recipes that need the network work over 127.0.0.1 (a server and a client in one program on a free port), so neither the
external network nor a cluster is required.
| Page | Recipes |
|---|---|
| Text and the command line | word frequencies, CSV parsing, command-line arguments, a table, files |
| JSON and time | JSON serialization and parsing, decoding errors, dates and durations |
| HTTP | a server with routes, middleware, a JSON request from a client |
| rpc and actors | a service with errors in its contract, a rate-limiting actor |
| Concurrency patterns | worker pool, pipeline, timeout, STM, streams |
| Error patterns | error enums, retry with a delay, a fallback path, defer |
| Testing patterns | tables, fixtures, mocks, snapshots, simulation, fuzzing |
| Generics and interfaces | Stack<T>, dyn interfaces, operators, custom iterators |
| Storage | ORM with SQLite: CRUD, queries, transactions; std.kv |
| Configuration and observability | config with profiles, logs, metrics and spans |
More features are shown by the projects (shop, bank-saga, counter-cluster) and the tour.