Tutorial

Learn Axioma by running it

A short, hands-on tour — from a variable binding to a recursive logic rule. Every example below runs right here in the page.

▶ Edit any example and press Run — or /Ctrl+Enter. Same WebAssembly interpreter as the playground; nothing leaves your browser. interpreter: loading…
LESSON 1

Saying something

println writes a line of output and takes any number of arguments. A line that is just a bare expression has a value — the runner shows it after . (That's the read-eval-print feel: every line evaluates to something.)

hello.axOpen in Playground ↗
LESSON 2

Bindings — the colon from REBOL

Axioma binds a name to a value with a colon: name: value. There is no let, no var, no = — the colon is inherited from REBOL (Carl Sassenrath, 1997), where word: value is the one way to define anything. It's terse and reads like a definition list.

You can also bind several names at once, left-to-right.

bindings.axOpen in Playground ↗
LESSON 3

Blocks — what [ ] means

Square brackets group a sequence of expressions into a block. A block evaluates to its last expression. This one idea does a lot of work in Axioma: it's how you sequence steps, and — as you'll see next — it's exactly how you write a function body.

(When a bracket holds comma-separated items instead, like [1, 2, 3], it's an array literal. Newlines or a single trailing expression make it a value-block.)

blocks.axOpen in Playground ↗
LESSON 4

Functions

A function is just a value — you bind it with : like anything else, and its body is a [ ] block. Call it with parentheses.

square.axOpen in Playground ↗

There's an optional named form, and a lightweight lambda … => for short functions:

forms.axOpen in Playground ↗

Functions can call themselves (recursion), and can return other functions that capture their surrounding scope (closures):

recursion.axOpen in Playground ↗
closure.axOpen in Playground ↗
LESSON 5

Composition — functions over collections

Functions are first-class, so you pass them around. map applies one to every item; filter keeps what matches; reduce folds a collection to a single value.

And because a function is a value, you can compose small ones into a pipeline:

compose.axOpen in Playground ↗
LESSON 6

Sets & comprehensions

Sets are first-class, and set-builder notation comes straight off the page. Read { n | n <- xs, cond } as “the set of n drawn from xs such that cond.” (mod is the word form of %.)

comprehension.axOpen in Playground ↗

The full algebra of sets is there too — union , intersection , difference \:

setops.axOpen in Playground ↗
LESSON 7

Quantifiers — logic that evaluates

The universal and existential quantifiers range over a set and evaluate to a truth value. Write them as words…

quantifiers.axOpen in Playground ↗

…or as the symbols mathematicians actually write — the same AST either way:

glyphs.axOpen in Playground ↗
LESSON 8

Logic & rules

Declare a relation, assert some facts, and write rules with <== (“holds when”). Rules can be recursive — here the engine computes the full transitive closure of a graph, Datalog-style, iterating to a fixpoint.

paths.axOpen in Playground ↗
LESSON 9

Concepts & the copula is

A concept is a class. Subclass with extends, make an instance with the indefinite article a (or an), and classify with Russell's copula is — which Axioma keeps precise: membership () for an instance, and class-inclusion () between two concepts.

concepts.axOpen in Playground ↗
LESSON 10

Beyond true and false

Real knowledge is sometimes missing and sometimes contradictory. Axioma builds that in: Belnap's four-valued logic has a value for “asserted and denied” (⊤⊥), and Kleene's three-valued logic handles the unknown (om) without collapsing.

truth.axOpen in Playground ↗

That's the core.

You've met bindings, blocks, functions, sets, logic, concepts and many-valued truth — enough to read most Axioma. Take any example into the full playground and keep going.

The full Axioma Manual and textbook are coming to the site — this tutorial is the slimmed-down tour.