OxL Reference

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.

PageRecipes
Text and the command lineword frequencies, CSV parsing, command-line arguments, a table, files
JSON and timeJSON serialization and parsing, decoding errors, dates and durations
HTTPa server with routes, middleware, a JSON request from a client
rpc and actorsa service with errors in its contract, a rate-limiting actor
Concurrency patternsworker pool, pipeline, timeout, STM, streams
Error patternserror enums, retry with a delay, a fallback path, defer
Testing patternstables, fixtures, mocks, snapshots, simulation, fuzzing
Generics and interfacesStack<T>, dyn interfaces, operators, custom iterators
StorageORM with SQLite: CRUD, queries, transactions; std.kv
Configuration and observabilityconfig with profiles, logs, metrics and spans

More features are shown by the projects (shop, bank-saga, counter-cluster) and the tour.

See also