Learn Rux

Rux is still in active development. As the language matures some syntax and features may change, and the course changes with it — every lesson is checked against the current compiler.

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 run and 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.

Getting startedInstall the toolchain and run your first program.
1The languageParts 1–13In order

Each part builds on the ones before it.

  1. 1. BasicsPrinting, values and their types · 12 lessons
  2. 2. OperatorsCombining values into new ones · 5 lessons
  3. 3. Control flowChoosing and repeating · 13 lessons Checkpoint: Thanks, FizzBuzz
  4. 4. FunctionsNaming a piece of work and reusing it · 7 lessons Checkpoint: Temperature
  5. 5. SequencesArrays, slices and tuples · 8 lessons Checkpoint: Prime
  6. 6. TypesStructs, enums and variants of your own · 13 lessons
  7. 7. PatternsEverything a match arm can say · 6 lessons
  8. 8. OptionalsA value that may be absent: T? · 6 lessons
  9. 9. ErrorsOperations that can fail: T ! E · 16 lessons Checkpoint: Calculator
  10. 10. Sum typesA value that is one of several types: A | B · 5 lessons
  11. 11. OwnershipWho owns a value, and when it is cleaned up · 10 lessons
  12. 12. InterfacesBehaviour that many types share · 12 lessons
  13. 13. GenericsTypes and functions that work for many types · 6 lessons
2In depthParts 14–17In order

Text, memory, numbers and collections, with the whole language to hand.

  1. 14. TextStrings, formatting, parsing and input · 13 lessons
  2. 15. MemoryPointers, raw memory and allocators · 14 lessons
  3. 16. NumbersNumbers in depth · 11 lessons Checkpoint: Circle, Quadratic
  4. 17. CollectionsVectors, maps, sets and queues · 7 lessons Checkpoint: Word count, Inventory
3Standard packagesParts 18–24Any order

A tour of the standard library. Pick the parts you need.

  1. 18. AlgorithmsSorting, searching and folding slices · 5 lessons Checkpoint: Statistics
  2. 19. FilesPaths, files and directories · 10 lessons
  3. 20. UtilitiesTime, randomness, hashing and UUIDs · 9 lessons Checkpoint: Guess, Age, Password, Launch
  4. 21. Data formatsReading and writing JSON and TOML · 5 lessons Checkpoint: Notes
  5. 22. PackagesModules, packages, libraries and tools · 10 lessons
  6. 23. Compile timeCode chosen while compiling · 7 lessons
  7. 24. PlatformThe operating system and the machine · 5 lessons Checkpoint: Melody
4ProjectsPart 25Checkpoints

Complete programs. Each one is ready as soon as its part is done — look for the flags.

  1. 25. ProjectsComplete small programs · 16 lessons

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.

No install yet?
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.

AfterProjects
3. Control flowThanks, FizzBuzz
4. FunctionsTemperature
5. SequencesPrime
9. ErrorsCalculator
16. NumbersCircle, Quadratic
17. CollectionsWord count, Inventory
18. AlgorithmsStatistics
20. UtilitiesGuess, Age, Password, Launch
21. Data formatsNotes
24. PlatformMelody

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.