Trace a value — the period
The most distinctive move in everyday Axioma: end a line with a period and it traces the value — prints it, no function call at all. Both halves are inspired by older languages: printing a value with a dot by Forth (where ., "dot", pops and prints the top of the stack), and ending a statement with a dot by Prolog (where every clause closes with .). Axioma's . does both at once — it shows a value and terminates the statement. (A trace shows the value as the language sees it, so a string keeps its quotes; println is the more familiar way to write clean output for a person.)
Because the dot terminates a statement, several can share one line — and the playground traces the last line for you automatically, which is the ⇒ you'll see in every example. (A dot directly before a digit is still a decimal point, so 3.14 is a number, not a trace.)
Bindings — REBOL's set-word colon
Axioma binds a name to a value with a colon: name: value — no let, no var. The colon-binding is inspired by REBOL (Carl Sassenrath, 1997), where word: is an atomic set-word — the colon is fused onto the word itself. Axioma adopts that look but treats : as an ordinary binding operator (its own token), so even x : 5 — with a space — still binds. (REBOL itself drew on Lisp, Forth, Logo and Self; the set-word notation is its own — Algol and Smalltalk used :=, Logo used make.)
: creates a binding; = reassigns an existing one — and the difference is enforced. Use = on a name you never declared and Axioma stops you, telling you to declare it with : first. Comparison for equality is a third thing again: ==.
You can also bind several names at once, left-to-right.
Blocks — the versatile [ ]
Square brackets are the most versatile punctuation in Axioma. At heart, [ ] is a block — a sequence of steps whose value is its last expression. That single idea powers a remarkable range of the language:
- the body of a function —
func(x) [ … ](next lesson); - the body of control flow —
if … then [ … ] else [ … ],while … [ … ],for … in … [ … ]; - a value-block you drop inline to compute something in a few steps (just below);
- a list comprehension —
[ x * x | x <- xs ](Lesson 6); - an array literal, when the brackets hold a comma-separated series of values —
[1, 2, 3]; - and the language & lens forms —
[python | … ],[sql | … ],[model | … ]— that run or translate another notation.
How does Axioma tell an array from a block? By context and content. In a body — a function or a control-flow branch — the brackets are always a block, yielding the last value (so if … then ["big"] else ["small"] gives the string "big", not a one-element array). Standing on their own, brackets of bare values are an array, while brackets that contain statements — like the bindings below — are a value-block.
That same block is the body of control flow — a loop runs a block per iteration, and an if (an expression) hands back the value of whichever branch it takes:
Functions
A function is just a value — you bind it with : like anything else, and its body is a [ ] block. Call it with parentheses.
There's an optional named form, and a lightweight lambda … => for short functions:
Functions can call themselves (recursion), and can return other functions that capture their surrounding scope (closures):
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:
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 %.)
The full algebra of sets is there too — union ∪, intersection ∩, difference \:
Quantifiers — logic that evaluates
The universal ∀ and existential ∃ quantifiers range over a set and evaluate to a truth value. Write them as words…
…or as the symbols mathematicians actually write — the same AST either way:
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.
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.
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.
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.