Skip to content

Syntax

Variable Assignment

You can assign values to variables using either သည် or =:

TIP

Note: When using သည် for assignment, you must include a space before and after သည်.

myst
အမည် သည် "မောင်မောင်"။
အသက် = ၂၅။

Both lines above are valid and equivalent.

Variable Naming

  • Variable names must be in Burmese. English letters are not allowed for variable names.
  • English (and other languages) can be used inside strings (i.e., within double quotes).

Valid:

myst
အမည် = "Maung Maung"။

Invalid:

myst
name = "မောင်မောင်"။ // ❌ Variable name in English is not allowed

Statement Ending

Statements can be ended with (Burmese period), but this is optional. You can also simply move to the next line to end a statement:

myst
အမည် သည် "မောင်မောင်"
အသက် သည် ၂၅။

Both with and without are valid.

Operators

  • + (ပေါင်း) — Addition/Concatenation
  • - (နှုတ်) — Subtraction
  • * (မြှောက်) — Multiplication
  • / (စား) — Division
  • == (တူ) — Equals
  • != (မတူ) — Not equals
  • > (ထက်ကြီး) — Greater than
  • < (ထက်ငယ်) — Less than
  • >= (ထက်ကြီးသို့မဟုတ်တူ) — Greater than or equal
  • <= (ထက်ငယ်သို့မဟုတ်တူ) — Less than or equal

Example:

myst
အရေအတွက် = ၁၀ + ၅

Assigns ၁၅ to အရေအတွက်.

Comments

Myst supports single-line comments using //. Comments are ignored by the interpreter and are used to add explanatory notes to your code.

Example:

myst
အမည် သည် "မောင်မောင်"။ // This is a comment
အသက် = ၂၅။ // Variable assignment with comment

// This is a standalone comment
နှစ်ဆ သည် လုပ်ဆောင်ချက်(ဂဏန်း) {
    ရလဒ် ဂဏန်း * ၂ // Return double the number
}။