Learn Rux
Welcome to Rux — a fast, compiled, strongly typed, multi-paradigm language that ships as a single small binary. This course takes you from installing the toolchain to writing complete programs. It assumes no Rux at all, and only a little programming: if you know what a variable and a loop are, you are ready.
How the course works
Every lesson teaches one idea and is backed by one small package in the Rux Examples repository. The package is a real program: it compiles, it runs, and its comments explain each line. A lesson page walks you through that program, shows what it prints, and points out the mistakes beginners usually make.
- Read the lesson page, top to bottom.
- Run the package with
rux runand compare the output with the page. - Change something — a value, a condition, a type — and run it again. Breaking a program on purpose and reading the compiler's message is one of the fastest ways to learn.
- Move on with the Next link at the bottom of the page. Each lesson lists the lessons it needs, so you can also jump around.
flowchart LR
read["Read the lesson"] --> run["rux run"]
run --> compare["Compare the output"]
compare --> change["Change the code"]
change --> check["rux check"]
check -- "error: read the message" --> change
check -- "it compiles" --> run
compare -- "understood" --> next["Next lesson"]The road map
Parts 1–17 build the language step by step and are best read in order. Parts 18–24 tour the standard packages: once the language parts are done, take them in any order. Part 25 holds complete small programs, each one a checkpoint you can attempt as soon as you have finished the part marked with its flag.
Each part builds on the ones before it.
- 1. BasicsPrinting, values and their types · 12 lessons
- 2. OperatorsCombining values into new ones · 5 lessons
- 3. Control flowChoosing and repeating · 13 lessons Checkpoint: Thanks, FizzBuzz
- 4. FunctionsNaming a piece of work and reusing it · 7 lessons Checkpoint: Temperature
- 5. SequencesArrays, slices and tuples · 8 lessons Checkpoint: Prime
- 6. TypesStructs, enums and variants of your own · 13 lessons
- 7. PatternsEverything a match arm can say · 6 lessons
- 8. OptionalsA value that may be absent: T? · 6 lessons
- 9. ErrorsOperations that can fail: T ! E · 16 lessons Checkpoint: Calculator
- 10. Sum typesA value that is one of several types: A | B · 5 lessons
- 11. OwnershipWho owns a value, and when it is cleaned up · 10 lessons
- 12. InterfacesBehaviour that many types share · 12 lessons
- 13. GenericsTypes and functions that work for many types · 6 lessons
Text, memory, numbers and collections, with the whole language to hand.
A tour of the standard library. Pick the parts you need.
- 18. AlgorithmsSorting, searching and folding slices · 5 lessons Checkpoint: Statistics
- 19. FilesPaths, files and directories · 10 lessons
- 20. UtilitiesTime, randomness, hashing and UUIDs · 9 lessons Checkpoint: Guess, Age, Password, Launch
- 21. Data formatsReading and writing JSON and TOML · 5 lessons Checkpoint: Notes
- 22. PackagesModules, packages, libraries and tools · 10 lessons
- 23. Compile timeCode chosen while compiling · 7 lessons
- 24. PlatformThe operating system and the machine · 5 lessons Checkpoint: Melody
Complete programs. Each one is ready as soon as its part is done — look for the flags.
Start here
Install the toolchain
Install rux on Windows, Linux, macOS or FreeBSD — or build it from source on any other platform. Prebuilt binaries cover x86-64 and AArch64.
Set up your editor
Add Rux syntax highlighting to Visual Studio Code, Sublime Text or Zed.
Build your first project
Create, build and run a project of your own, then clone the Examples repository the lessons are built on.
Take the first lesson
Start with 1.1 Hello, World and follow the Next links from there.
The Playground runs the compiler in your browser. Paste any snippet from a lesson to try it straight away.
Checkpoint projects
Each project in Part 25 combines what the earlier parts taught into one complete program. Try to write it yourself first, then compare with the lesson.
| After | Projects |
|---|---|
| 3. Control flow | Thanks, FizzBuzz |
| 4. Functions | Temperature |
| 5. Sequences | Prime |
| 9. Errors | Calculator |
| 16. Numbers | Circle, Quadratic |
| 17. Collections | Word count, Inventory |
| 18. Algorithms | Statistics |
| 20. Utilities | Guess, Age, Password, Launch |
| 21. Data formats | Notes |
| 24. Platform | Melody |
Learn with an AI assistant
Claude Code, Codex and similar coding assistants make good study partners: they can explain a lesson line by line, quiz you, and review your own version of a program. Rux is a new language, so they need a little context first — Learn Rux with AI shows how to set that up. Every lesson page also has Copy page and Open in Claude / ChatGPT buttons that hand the lesson to an assistant for you.
Going further
The course teaches by example. When you want the full rules, the Rux Reference specifies the language, the CLI Reference documents every rux command, and the API Reference lists the standard packages. The cheat sheet puts the syntax from the whole course on one page.