Skip to content

Language Basics

Arena Agent edited this page Sep 18, 2026 · 1 revision

Language Basics | مبانی زبان

Plix source files use .px. Statements commonly end with ;, and blocks use braces.

Functions | توابع

func add(a: int, b: int) -> int {
    return a + b;
}

Type annotations are optional where inference is sufficient:

func square(x) { return x * x; }

Control flow | کنترل جریان

if (score >= 60) {
    say("passed");
} else {
    say("try again");
}

for item in items {
    say(item);
}

The language also supports loops, pattern matching, closures, and errors. For exact grammar, see the grammar reference.

Collections and interpolation | مجموعه‌ها و درون‌گذاری

let names = ["Ada", "Linus", "Grace"];
say("count = ${names.len()}");

Start with the interpreter, then use plix check before compiling larger programs.

Clone this wiki locally