say 2 + 3 * 4; # 1414
July 7, 2026
Part of I. A Diurnal Cipher of Raku.
We have mastered the vessels of storage, but we have yet to speak of the dark, unseen forces that govern the assembly of our logic. In the mundane world, this is called “precedence,” but in our journey, it is the Operator’s Curse: a rigid, invisible hierarchy that dictates which runes are invoked first, and which must wait their turn in the void.
Every operator in Raku is assigned a “precedence” value—a numerical weight that determines its dominance. When an expression contains multiple operators, those with higher precedence consume their surrounding values before those with lower precedence can even stir.
Consider the eternal struggle between addition and multiplication:
To the uninitiated, this might seem ambiguous. But Raku’s architecture mandates that * (multiplication) possesses a higher precedence than + (addition). The multiplication is anchored first, and only then does the addition complete the ritual.
While there are many levels in Raku’s operator hierarchy, three tiers are vital for the survivor to recognize immediately:
| Precedence | Operators | Purpose |
|---|---|---|
| Highest | . , () |
Method calls and grouping |
| Middle | * , / |
Multiplicative actions |
| Lowest | + , - |
Additive actions |
A Warning to the Neophyte: The most powerful tool at your disposal is the parentheses
(). Whenever the natural order of precedence threatens to lead your logic into madness, bind your expression in parentheses. It forces the compiler to suspend its hierarchy and obey your command first.
The operator = (assignment) is notoriously weak. It often possesses the lowest precedence of all, ensuring that every other operation within a statement concludes before the final result is bound to a container.
Because * is stronger than +, and + is stronger than =, the calculation 1 + (2 * 3) is fully resolved to 7 before the assignment operator ever touches the value.
Raku contains a unique category of operators that “chain” rather than follow standard precedence rules, specifically for comparisons:
This is not a sequence of two independent checks. Raku views 1 < $n < 10 as a singular, unified statement of truth. It checks the entire range simultaneously, an elegance rarely found in the primitive, C-derived languages of the past.
Understanding precedence is the final step in moving from a mere script-writer to an architect of the Language. Without this knowledge, your complex expressions will behave in ways that seem erratic and occult. Once you grasp which operators dominate the others, you can wield them with surgical precision, ensuring the compiler acts exactly as your will dictates.
We have now defined the vessels, the context, the flattening, the aggregation, and the precedence. In our next transmission, we shall finally move beyond simple data and begin to invoke The Multi-Dispatch—the art of defining many destinies for a single name.