Learn by running

Tour of Lux

8 short chapters, 15 live cells. Every example runs in your browser — edit anything, press Run, and read the receipt: output, evaluation steps, and a modeled energy figure. No server, no account; nothing leaves the page.

By the last chapter you'll have built a live reactive app and measured two implementations of the same function against each other — in joules.

This page is itself a Lux program. It was authored as a Lux app (view source: tour.lux in this directory) and rendered to the HTML you are reading by lux build --target html. The bar at the bottom is that build's energy receipt. The interactive version lives at /docs/tour.
01
Hello, Lux

Run your first program and read your first receipt.

2 cells
02
Values

Bindings, mutability, lists, and records.

2 cells
03
Functions & pipes

Definitions, lambdas, and the pipe operator.

2 cells
04
Control flow

if/else, pattern matching, and loops.

2 cells
05
Working with data

List, string, and record builtins.

2 cells
06
Signals

Reactive state, one primitive.

1 cell
07
Apps & views

Declarative UI that renders live, right here.

2 cells
08
Energy as an observable

The part that makes Lux, Lux.

2 cells
TourOfLux -- built with Lux 0.013724 J | 197 ops