First Program
This page walks through a few practical first steps in RayQuiro 0.0.2.
Smallest Program
print("RayQuiro 0.0.2 is running");
Save it as hello.rq and run:
rqio hello.rq
Variables And Expressions
var language = "RayQuiro";
var version = "0.0.2";
print(language + " " + version);
A Small Function
fn sum(a, b) {
return a + b;
}
print("7 + 5 =", sum(7, 5));
If you define main(), call it yourself:
fn main() {
print("main() is running");
}
main();
Arrays And Loops
var modes = ["run", "vm", "pack"];
for (var i = 0; i < len(modes); i = i + 1) {
print("mode:", modes[i]);
}
Using Built-In System Modules
import rayquiro.time as time;
import rayquiro.json as json;
var started = time.now_ms();
var data = json.parse("{\"name\":\"RayQuiro\",\"version\":\"0.0.2\"}");
print(data["name"]);
print(data["version"]);
print("started at", str(started));
Running Through A Project
If your folder contains:
rqproject.jsonmain.rq
then inside that folder you can simply run:
rqio
That is the normal project workflow after:
rqio init my-app
cd my-app
rqio
VM Packaging
To package a supported core script into bytecode:
rqio pack hello.rq
Run the resulting package:
rqio build/hello.rqb
Native Build
To create a Windows executable:
rqio build hello.rq
In 0.0.2, normal build flow does not treat generated C++ as a public user artifact.
Recommended Next Steps
Continue with: