the shape of the language
Reading Vision
You already know how to read this. The shapes are familiar from sentences.
Words, not symbols
Most languages inherited their syntax from C: braces, semicolons, ==,
+=, ->. Vision dropped all of that. Where other languages
write symbols, Vision writes words.
Arithmetic uses plus, minus, times,
divided by. Comparison uses is, is not,
is greater than. Logic uses and, or,
not. The only punctuation in normal code is the comma, the colon
after a block opener, and double-quotes around text.
The result is code that a non-programmer can read aloud and mostly understand. That is not an accident.
Naming things
A name is bound with is. A constant uses is always.
The name comes first, then the value — like a sentence.
a guest is "Marigold" a count is always 100
Names are yours to choose. Pick words that say what the thing is: the total,
a path, the result. Vision has no naming convention rules —
just the good sense to name things clearly.
The shape of a verb
Verbs (functions) are introduced with to. Inputs are declared with
given. The result is handed back with answer.
to greet, given a name: say "hello, " followed by name answer "done"
Reading it aloud: "to greet, given a name: say hello followed by the name, answer done." That is a complete, working Vision verb.
Indentation makes blocks
There are no braces in Vision. Indentation defines structure — the same way English uses paragraphs. A colon opens a block; the indented lines beneath it belong to it.
to begin: if the total is greater than 0 say "positive" otherwise say "zero or below"
Four spaces per level is the convention. The compiler enforces consistency — mixing tabs and spaces is an error.
Frame words
Vision's grammar is made of a fixed set of frame words: to,
given, if, but if, for each,
answer, the, is, and so on. These are the
structural glue. In syntax highlighting they appear slightly muted — because the
names you choose carry the meaning, and the frame should recede.
Every word in a Vision line is either a frame word or a name you chose. There are no hidden keywords you have to memorise; the whole frame is listed in The grammar.