Skip to main content
Version: 0.0.1

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 .rq files
  • 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.web
  • rayquiro.ui
  • rayquiro.app
  • rayquiro.engine
  • rayquiro.fs
  • rayquiro.env
  • rayquiro.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:

  1. direct local path, such as ./lib/math.rq
  2. project-local .rq_modules/
  3. 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 root
  • build/ and .rq_cache/ are also resolved from the project root
  • rqio with no file argument uses the configured entry

Best Practices

For 0.0.1, these conventions work best:

  • use .rq for 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;