စံကား

01

The language

What a Zaka program is, and a map of the chapter that states the rules of the language.

A Zaka program is a list of sentences, and each sentence ends with the Burmese full stop ။. The VM runs the sentences from the first to the last. A sentence follows Burmese word order: first the things it talks about, each with a small word (a particle) after it that marks its role, and last the verb, which decides what the sentence means.

စံကား

Expected output

၅

The last sentence of the program is built like this:

က နှင့် ခ ၏ ပေါင်းလဒ် ကို ပြသပါ ။
statement
├── clause (makes a value)
│   ├── operand က, then the particle နှင့်   (first of two)
│   ├── operand ခ, then the particle ၏       (closes the operands)
│   └── verb ပေါင်းလဒ်                       (sum)
├── particle ကို                             (marks the value to show)
├── verb ပြသပါ                               (print: makes the statement)
└── ။                                        (ends the sentence)

A verb that makes a value, such as ပေါင်းလဒ်, forms an expression. A verb that gives a command, such as ပြသပါ, forms a statement. The compiler reads both with one set of rules.

The pages of this chapter

PageWhat it states
Source text and wordsthe encoding, ။ and ၊, spaces, comments, names, number, character and string literals, reserved words
Kinds and valuesthe integer, decimal, character and true/false kinds with their ranges, sizes and defaults, and the short names that messages use
Conversionsthe conversion expression, which pairs convert and what happens to the value, and the widening that needs no words
Expressionsliterals, names and the operators: arithmetic, comparison, logic and bitwise, with precedence, division, overflow and grouping
Statementseach form of statement with its shape, the statement verbs and the error of a missing verb
Names and scopeblocks, shadowing, constants, where a name can be seen, and the errors ZK0301 to ZK0308
Functionsdeclaring, calling and returning
Pointersaddresses, the heap and pointer arithmetic
Ownership and borrowingthe rules that keep a pointer from outliving its block
Listsfixed lists, their cells and kinds
Natural wordingwhich particle and which ending read well, and the warnings for the others

The pages go from the smallest unit to the largest: words, then the kinds of value, then expressions and statements, then names. Functions, pointers, owners and lists build on those. Where a rule has a gentler introduction, the page links to the Learn book. The error codes (ZK0101 and the rest) are listed in Error messages, and the words of the language in Reserved words.