Recipes
Task-oriented examples. Each page focuses on one theme and shows
patterns you can paste into a .axle file and run.
If you’re new, read the Language tour and Conventions first — they cover the shape of the language and the style every recipe assumes.
Index
| Recipe | What you’ll learn |
|---|---|
| Collections | ArrayList, HashMap, HashSet, iteration patterns |
| Object-oriented programming | classes, inheritance, traits, generics |
| Files and I/O | File, BufferedReader / Writer, streams |
| Strings and text | string ops, StringBuilder, parsing, regex, JSON |
| Numeric and time | Math, Random, LocalDateTime, timestamps |
| CLI tools and system | argv, env, paths, child processes, logging |
The concurrency and error-handling patterns have their own chapters next to the language features they exercise :
| Pattern | Chapter |
|---|---|
spawn / await / Shared<T> / synchronized | Concurrency → Multithreading |
| atomics, locks, channels, latches, semaphores | Concurrency → Concurrency primitives |
try / catch / throw, defer, custom exceptions | Errors → Error handling |
How to read these
Every example is a self-contained snippet. Where it would compile
as a full program, it’s shown as a fn main() : i32. Where it
illustrates a method or class fragment, just paste it into a
larger program.
Throws clauses are listed when they’re non-obvious — the compiler will tell you if you miss one.
Most examples don’t show error handling for IOException / IndexOutOfBoundsException etc. ; in real code, propagate or
catch them per error-handling.md.
See also
- Language tour — the syntax these recipes assume.
- Conventions — naming, file layout, when to use which ownership mode.
- Memory model — how
new T(...)is routed to stack / arena / heap / shared. Shared<T>reference counting — the refcount lifecycle behind the multithreading recipes.- Standard library overview — the module map every recipe pulls from.
- Concept index — every concept on one page with a link to where it’s documented.