စံကား

Learn

Zaka through Examples

Learn the Zaka programming language one small, runnable example at a time.

Zaka (စံကား) is a programming language written in Burmese. A Zaka program is a list of Burmese sentences such as "မင်္ဂလာပါ" ဟု ပြသပါ။ ("show: hello"). The computer carries them out one after another.

These pages teach the language through examples. No other programming language is needed beforehand. Each page has:

  • a short program, with comments that explain each line,
  • the exact output the program prints,
  • a table that glosses the Burmese words used,
  • a Hands on section that suggests a small change to make to the program.

Read the pages in order. Each page builds on nothing but what the pages before it have shown.

How to run the examples

The fastest route is the online Zaka Explorer. Paste a program into the editor and press Run.

To run programs on a local computer, build the compiler zakac from the Zaka source folder. This needs Rust installed first.

cargo build --release -p zakac

Save a program in a file whose name ends in .zaka (or .zk), then run it:

./target/release/zakac run hello.zaka

A note on the examples

  • Example programs use Burmese names such as အသက် (age). The comment next to a name gives its meaning in English.
  • Zaka prints numbers with Burmese digits (၁၂၃), even when the source writes them with Western digits (123).
  • When an example is meant to fail, the page states this and shows the message the compiler prints.

Start with Hello, world, or browse the table of contents.

These pages teach through examples and leave some details out. The Docs give the full rules of the language, explain how the compiler and the VM work, and list the reserved words, the operator precedence and each error code.

Chapters

  1. 01Hello, world
    1. Comments
    2. Printing
  2. 02Zaka sentences
    1. Particles
    2. Spaces between words
  3. 03Values and kinds
    1. Integers
    2. Writing integers
    3. Decimal numbers
    4. Characters
    5. True and false
    6. Text in quotes
  4. 04Variables
    1. Constants
    2. Changing a variable
    3. Names
    4. Blocks and scope
  5. 05Operators
    1. Arithmetic
    2. Comparison
    3. Logic
    4. Bitwise operators
    5. Converting between kinds
    6. Grouping and order
  6. 06Control flow
    1. If and else
    2. While loops
    3. Counted loops
    4. Generic loops
    5. Break and continue
  7. 07Functions
    1. Parameters
    2. Results
    3. Recursion
  8. 08Pointers and the heap
    1. Changing the caller's variables
    2. The heap
    3. Pointer arithmetic
    4. Growing and shrinking
    5. Ownership and borrowing
    6. Pointer mistakes
  9. 09Lists
    1. Passing and comparing lists
    2. Lists of lists
    3. List mistakes
  10. 10Natural Zaka
  11. 11Example programs
    1. FizzBuzz
    2. Greatest common divisor
    3. Fibonacci numbers
    4. The Collatz sequence