The idea
qdx is a small compiled language. A program is a set of functions, and running it means calling the one named main. The compiler turns your source files into a single Linux executable that depends on nothing else.
Three rules shape the rest of the language, and knowing them early saves surprise later.
Nothing changes after it is made
A name is given a value once. There is no assignment, so a value you were handed is the value you still have ten lines later. Records and bytes cannot be edited either. To get something different, you make a new value from the old one.
This also means there are no loops, because a loop needs something that changes. Repetition is written as a function that calls itself, and chapter 4 shows why that is less work than it sounds.
Everything produces a value
There are no statements that only do something. An if is an expression with two branches, and both branches produce a value of the same type, so an if always has an else. A block in braces produces the value of its last line. A function’s result is simply the value of its body.
There is one way to write each thing
Where other languages offer a choice, qdx picks one form and requires it. A record is always made with its fields named and in declared order. A match always lists every case. A union case is always written with parentheses, even when it holds nothing. The compiler rejects anything else and says which form it wanted.
The benefit is that code reads the same no matter who wrote it, and a mistake is usually caught before the program runs.
What it leaves out
qdx has no comments, no null, no exceptions, no generics and no function values. Some of those may come later. Today a name that explains itself takes the place of a comment, a union takes the place of null, and a function that stops the program takes the place of an exception.
The next chapter compiles a first program.