First Program
This page walks through the smallest RayQuiro programs and shows the difference between running a script and building a native executable.
Smallest Program
print("RayQuiro CLI is live");
Save it as hello.rq and run:
rqio hello.rq
Variables And Expressions
var project = "RayQuiro";
var major = 0;
var minor = 0;
var patch = 1;
print(project, str(major) + "." + str(minor) + "." + str(patch));
Your First Function
fn sum(a, b) {
return a + b;
}
print("7 + 5 =", sum(7, 5));
Functions are not auto-run. If you define a main() function, call it yourself:
fn main() {
print("RayQuiro main()");
}
main();
Condition And Loop
var i = 0;
while (i < 3) {
print("step", i);
i = i + 1;
}
Arrays
var colors = ["red", "green", "blue"];
print(colors[0]);
print(len(colors));
Build Instead Of Run
To create a Windows executable:
rqio build hello.rq
This writes an executable into the current project's build/ directory unless you override the output with -o.
Run Through rqproject.json
If a folder contains:
rqproject.jsonmain.rq
then you can run the project by entering that folder and typing:
rqio
That is the normal workflow after:
rqio init my-app
cd my-app
rqio
Suggested Next Steps
After this page, continue in this order:
- Syntax Basics
- Imports and Modules
- built-in framework pages