Axle v0.14.1

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

RecipeWhat you’ll learn
CollectionsArrayList, HashMap, HashSet, iteration patterns
Object-oriented programmingclasses, inheritance, traits, generics
Files and I/OFile, BufferedReader / Writer, streams
Strings and textstring ops, StringBuilder, parsing, regex, JSON
Numeric and timeMath, Random, LocalDateTime, timestamps
CLI tools and systemargv, env, paths, child processes, logging

The concurrency and error-handling patterns have their own chapters next to the language features they exercise :

PatternChapter
spawn / await / Shared<T> / synchronizedConcurrency → Multithreading
atomics, locks, channels, latches, semaphoresConcurrency → Concurrency primitives
try / catch / throw, defer, custom exceptionsErrors → 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

recipesexampleshow-tocookbook