Quick Tour¶
A 15–20 minute walkthrough of Q++.
1. Create a Project¶
This creates src/main.q and qpp.toml.
2. Variables¶
make— immutable bindingmake shift— mutable variable
3. Functions¶
craft— functionsend— return
4. Control Flow¶
check (x > 0) {
print("positive");
}
otherwise {
print("non-positive");
}
loopwhile (i < 10) {
i = i + 1;
}
foreach item in arr {
print(item);
}
check/otherwise— if / elseloopwhile— while loopforeach— iterate over array
5. Structs¶
form Point {
x: i32,
y: i32
}
craft main() -> void {
make shift p: Point = ...;
p.x = 10;
p.y = 20;
send;
}
6. Modules¶
bring "std.fs";
craft main() -> void {
make f = fs.open_file("data.txt", "r");
check (f != 0) {
make content = fs.read_all(f);
fs.close(f);
print(content);
}
send;
}
7. Build and Run¶
Next Steps¶
- Language Reference — Full syntax
- Standard Library — Available modules
- CLI Reference — All commands