Wax
View on GitHub

The Wax standard

What Wax is now, by topic. DECISIONS.md records how each rule was decided; this standard says what the rules are today.

How it's written

  • DECISIONS.md is the source. Every rule here names its decision, as in "(D7)". Where the two disagree, the decision wins and the standard is wrong.
  • Wax takes many rules from Unio (D15, D16, D22). Those name Unio's decision, as in "(Unio D170)", and point to the chapter of Unio's standard that has them in full. Unio's examples are read in Wax's syntax, as the table below shows.
  • Undecided means "Not decided". Anything the decisions leave open is marked Not decided where it would go, never filled in here. A building session stops there with "not designed yet" (IMPLEMENTATION.md, rule 11).
  • No compatibility promise. Any new version of Wax may change any rule here, and scripts and hosts are updated to match (D137).

Reading Unio's rules in Wax's syntax

Where a chapter here points to Unio's standard, Unio's examples change only as Wax's decisions say:

UnioWaxDecided in
proc.main: … end proc.main around the programthe script's top level, run once when it's loadedD4
let $x: Whole = 0;x = 0, the type worked outD2, D7, D8
var $x: Whole = 0;mut x = 0D2
$xxD7
; at the end of a statementnothing: the line ends itD8
: at the end of an opening linenothingD9
else ifelifD10
proc name[$a: Whole] returns Whole:proc name[a: Whole] -> Whole, types always writtenD21, D45, D81
show_msg("{x}")"{x}": every text fills its braces in bothD75
for each $x in $xs:for_each x in xsD146
show_msg, ask, randomdoors, if the host opens them, under the names it choosesD11
.unio.waxD25

Chapters

  1. Terms
  2. Lines and blocks: lines, end, indentation, files
  3. Variables and values: making and changing variables, mut, unused, names' spelling, values
  4. Procedures: definitions, families, worked-out types, calls, labels, defaults and slides
  5. Control flow: if, elif, comparisons, logic, while, for_each and break
  6. Types: Whole, Float, Bool, Text, lists and arrays, records, dictionaries, options and match, Maybe, filling in text, converting
  7. Failures: ?, ?? and otherwise
  8. Built in: what Wax provides itself
  9. Hosts: loading, doors, narrowings on doors, IDs and limits
  10. Checks and messages: when checks run, build modes, and how the host is told