This guide gets a new developer from install to a working .sona program in
5-10 minutes.
Estimated time: 5-10 minutes.
Documentation truth rule: if this page and runtime behavior disagree, runtime behavior wins and this page must be corrected before release.
Use Python 3.11 or newer.
python -m pip install sona-langCheck the CLI:
sona --versionExpected shape:
Sona 0.15.1
Bash or macOS/Linux shell:
echo 'print("Hello, Sona!")' > hello.sonaWindows PowerShell:
'print("Hello, Sona!")' | Out-File -Encoding utf8 hello.sonaRun it with either CLI form:
sona run hello.sonaor:
sona hello.sonaExpected output:
Hello, Sona!
Create math_demo.sona:
import math;
let total = math.add(2, 3);
print("2 + 3 = " + total);
Run it:
sona run math_demo.sonaCreate this broken file:
print(total);
Run it:
sona run broken.sonaSona should print a short diagnostic. The important part is the hint: define the
value before using it. See the full diagnostics contract in
docs/errors/v0.14-diagnostics.md.
Corrected version:
let total = 5;
print(total);
Official examples are source-repository examples. They are validated by release tests, but installed packages are not required to include them.
From a source checkout:
sona run examples/hello.sonaTo validate the full official example suite:
python tools/run_examples.pysona --versionprints one line.sona --helpis grouped and human-readable.sonawith no arguments prints help to stderr and exits1.- CLI errors print to stderr.
- CLI errors exit with a nonzero code.
- Stack traces are hidden unless explicitly requested.