Imports and Modules
RayQuiro 0.0.1 supports local files, built-in namespaces, and installed frameworks.
Import Forms
There are two import styles.
Full module import
import "./lib/math.rq" as math;
print(math.sum(7, 5));
print(math.label);
Selective import
from "./lib/math.rq" import sum, label as math_label;
print(sum(9, 4));
print(math_label);
What Can Be Imported
You can import:
- local
.rqfiles - built-in namespaces such as
rayquiro.web - installed frameworks such as
telebot
Local File Imports
Use a string path when importing a local file:
import "./lib/math.rq" as math;
from "./lib/math.rq" import sum;
Typical project example:
my-app/
main.rq
lib/
math.rq
main.rq
import "./lib/math.rq" as math;
print(math.sum(4, 8));
Built-in Namespaces
These namespaces are built into RayQuiro:
rayquiro.webrayquiro.uirayquiro.apprayquiro.enginerayquiro.fsrayquiro.envrayquiro.process
Examples:
import rayquiro.web as web;
from rayquiro.fs import write, read;
import rayquiro.engine;
Engine Alias
raytolfas.engine is also accepted as an engine alias in 0.0.1:
import raytolfas.engine as engine;
Alias Imports
as creates a namespace alias:
import rayquiro.web as site;
site.begin("Demo", "build/index.html");
You can also alias individual bindings:
from "./lib/math.rq" import label as project_label;
Module Resolution Order
When RayQuiro resolves a non-built-in module, it checks in this order:
- direct local path, such as
./lib/math.rq - project-local
.rq_modules/ - global
%USERPROFILE%/.rqio/frameworks
This means you can install a framework locally per project or globally for the current user.
Local Frameworks
Install into the current project:
rqio install telebot --local
This writes into:
./.rq_modules/telebot
Now your project can import:
from telebot import bot, run_polling;
Global Frameworks
Install for the current user:
rqio install telebot
This writes into:
%USERPROFILE%/.rqio/frameworks
Installing From GitHub
Direct GitHub install:
rqio framework install RayQuiro/Telebot
rqio framework install RayQuiro/Telebot@main
Installing From The Approved Registry
Registry-based install:
rqio install telebot
rqio framework install telebot
Registry URL:
https://raw.githubusercontent.com/Raytolfas/RayQuiroAssets/main/frameworks.json
Project File And Imports
rqproject.json does not change import syntax directly, but it defines the active project root. That matters because:
.rq_modules/is resolved relative to the project rootbuild/and.rq_cache/are also resolved from the project rootrqiowith no file argument uses the configuredentry
Best Practices
For 0.0.1, these conventions work best:
- use
.rqfor all source files - keep shared project code in
./lib/or./src/ - install third-party frameworks into
.rq_modules/for project-local reproducibility - use aliases for long built-in module names
Example:
import rayquiro.web as web;
import "./lib/theme.rq" as theme;
from rayquiro.fs import write;