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 -- "understood" --> next["Next lesson"]
compare -- "experiment" --> change["Change the code"]
change -- "run it again" --> runThe road map
Parts 1–17 build the language step by step and are best read in order. Parts 18–26 tour the standard packages: once the language parts are done, take them in any order. Part 27 holds complete small programs, each one a checkpoint you can attempt as soon as you have finished the part listed for it under Checkpoint projects.
Install the toolchain and run your first program.
Parts 1–13 · Each part builds on the ones before it.
- 1BasicsPrinting, values and their types12 lessons
- 2OperatorsCombining values into new ones5 lessons
- 3Control flowChoosing and repeating14 lessons
- 4FunctionsNaming a piece of work and reusing it7 lessons
- 5SequencesArrays, slices and tuples9 lessons
- 6TypesStructs, enums and variants of your own13 lessons
- 7PatternsEverything a match arm can say6 lessons
- 8OptionalsA value that may be absent: T?7 lessons
- 9ErrorsOperations that can fail: -> T ! E, throw, and handling with !, !! and catch16 lessons
- 10Sum typesA value that is one of several types: A | B5 lessons
- 11OwnershipWho owns a value, and when it is cleaned up11 lessons
- 12InterfacesBehaviour that many types share12 lessons
- 13GenericsTypes and functions that work for many types7 lessons
Parts 14–17 · Text, memory, numbers and collections, with the whole language to hand.
Parts 18–26 · A tour of the standard library. Pick the parts you need.
- 18AlgorithmsSorting, searching and folding slices7 lessons
- 19FilesPaths, files and directories11 lessons
- 20UtilitiesTime, randomness, hashing and UUIDs11 lessons
- 21Data formatsReading and writing JSON and TOML8 lessons
- 22PackagesModules, packages, libraries and tools12 lessons
- 23Compile timeCode chosen while compiling7 lessons
- 24PlatformThe operating system and the machine5 lessons
- 25ConcurrencyThreads, atomics, locks and channels8 lessons
- 26SystemsProcesses, command lines, logs and networks7 lessons
Part 27 · Complete programs that combine what the earlier parts taught.
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 27 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 |
| 26. Systems | Grep |
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.