A complete index of all built-in globals, core classes, native standard modules (std:*), and Kyro library modules (lib:*).
1. Core Globals & Reflection
Functions available globally in every script without needing imports.
| Name | Kind | Description | Doc Link |
|---|---|---|---|
type_of(val) |
Function | Returns the class object of a value | core.md |
range(start, end, step) |
Function | Generates a sequential list of numbers | core.md |
is_instance(item, class) |
Function | Checks if an item inherits from a target class | core.md |
dir(item) |
Function | Returns a list of attribute/method names on an item | core.md |
id(item) |
Function | Returns the unique memory address of an item | core.md |
use(module_name) |
Function | Imports a native std:* or library lib:* module |
core.md |
2. Built-In Type & Exception Classes
All types and exceptions inherit from the base Object class.
| Class Name | Type Category | Superclass | Doc Link |
|---|---|---|---|
Object |
Base Root Class | None | OOP.md |
Number |
Primitive | Object |
core.md |
String |
Primitive | Object |
core.md |
List |
Primitive Collection | Object |
core.md |
Dict |
Primitive Map | Object |
core.md |
Bool |
Primitive | Object |
core.md |
Nil |
Primitive | Object |
core.md |
Callable |
Invokable Type | Object |
core.md |
Class |
Class Object Type | Object |
core.md |
Exception |
Base Exception | Object |
core.md |
ValueError |
Exception | Exception |
core.md |
TypeError |
Exception | Exception |
core.md |
AttributeError |
Exception | Exception |
core.md |
IndexError |
Exception | Exception |
core.md |
3. Native Standard Library Modules (std:*)
Modules written natively in Rust. Import via use("std:<module>").
std:fs (Filesystem Operations)
- Documentation:
std/fs.md
| Function | Return Type | Description |
|---|---|---|
read_file(path) |
String | Reads file content as text |
write_file(path, content) |
Nil | Overwrites text to a file |
append_file(path, content) |
Nil | Appends text to a file |
read_bytes(path) |
List | Reads binary data as a byte list |
write_bytes(path, bytes) |
Nil | Writes a byte list to a binary file |
exists(path) |
Bool | Checks if file or directory exists |
is_file(path) |
Bool | Checks if path is a regular file |
is_dir(path) |
Bool | Checks if path is a directory |
is_absolute(path) |
Bool | Checks if path is absolute |
remove_file(path) |
Nil | Deletes a file |
copy(src, dest) |
Nil | Copies a file |
rename(old, new) |
Nil | Renames/moves a file or folder |
create_dir(path, recursive) |
Nil | Creates a directory |
remove_dir(path, recursive) |
Nil | Deletes a directory |
read_dir(path) |
List | Lists file/directory names in a folder |
file_size(path) |
Number | Returns file size in bytes |
canonicalize(path) |
String | Resolves absolute path |
parent_dir(path) |
String | Returns parent folder path |
filename(path) |
String | Extracts filename |
extension(path) |
String | Extracts file extension |
temp_dir() |
String | Returns OS temporary folder path |
temp_file(prefix) |
String | Creates unique temp file path |
modified_time(path) |
Number | Returns last modified epoch timestamp |
metadata(path) |
Dict | Returns full file system metadata dictionary |
std:io (Console I/O & Terminal Controls)
- Documentation:
std/io.md
| Function | Return Type | Description |
|---|---|---|
print(val) |
Nil | Prints value to stdout without newline |
println(val) |
Nil | Prints value to stdout with newline |
input(prompt) |
String | Reads line of input from stdin |
read_secret(prompt) |
String | Masked input reading for passwords |
color(text, color_name) |
String | Applies ANSI colors (green, red, bold, etc.) |
clear() |
Nil | Clears terminal screen |
flush() |
Nil | Flushes stdout buffer |
is_tty() |
Bool | Checks if output is an interactive terminal |
set_cursor(x, y) |
Nil | Positions terminal cursor at col x, row y |
write_err(val) |
Nil | Prints value directly to stderr |
std:os (Operating System & Processes)
- Documentation:
std/os.md
| Function | Return Type | Description |
|---|---|---|
args() |
List | Returns process command-line arguments |
load_dotenv(path) |
Nil | Loads environment variables from .env |
get_env(key) |
String | Nil | Gets environment variable value |
set_env(key, val) |
Nil | Sets process environment variable |
get_envs() |
List | Returns all process environment variables |
exit(code) |
Nil | Immediately terminates current process |
get_pid() |
Number | Returns current Process ID |
platform() |
String | Returns target OS (windows, linux, macos) |
arch() |
String | Returns host CPU architecture |
current_dir() |
String | Returns current working directory |
set_current_dir(path) |
Nil | Changes process working directory |
execute(command, args) |
Dict | Runs subprocess and captures stdout/stderr/exit_code |
std:time (Clocks & Benchmarking)
- Documentation:
std/time.md
| Function | Return Type | Description |
|---|---|---|
clock() |
Number | Current Unix timestamp in seconds |
clock_ms() |
Number | Current Unix timestamp in milliseconds |
now() |
Dict | Calendar components dict (year, month, day, etc.) |
format(timestamp, fmt) |
String | Formats epoch timestamp as date-time string |
sleep(ms) |
Nil | Pauses thread execution for milliseconds |
is_leap_year(year) |
Bool | Checks if a given year is a leap year |
time_execution(func) |
Number | Benchmarks function execution time in ms |
std:util (Conversions & Info)
- Documentation:
std/util.md
| Function | Return Type | Description |
|---|---|---|
to_string(val) |
String | Converts any value to its string representation |
to_number(val) |
Number | Converts string, bool, or nil to a number |
info() |
Dict | Returns runtime parameters (language, version) |
std:ffi (C Dynamic Library Invocation)
- Documentation:
std/ffi.md
| Class / Function | Return Type | Description |
|---|---|---|
load(path) |
FfiLibrary |
Dynamically loads .dll / .so shared library |
FfiLibrary.bind(name, ret, params) |
Callable | Binds C function symbol to Kyro callable |
4. Kyro Library Modules (lib:*)
Modules written in Kyro. Import via use("lib:<module>").
lib:json (JSON Encoding & Decoding)
- Documentation:
lib/json.md
| Function / Class | Description |
|---|---|
JSONDecodeError |
Exception class thrown on malformed JSON |
loads(json_str) |
Parses JSON string into Kyro dict/list/value |
dumps(val, indent) |
Serializes Kyro dict/list/value to JSON string |
load(filepath) |
Reads file and parses JSON content |
dump(val, filepath) |
Serializes Kyro value and writes to JSON file |
lib:math (Trigonometry & Math Utilities)
- Documentation:
lib/math.md
| Name | Kind | Description |
|---|---|---|
PI |
Constant | $\pi = 3.141592653589793$ |
TWO_PI |
Constant | $2\pi = 6.283185307179586$ |
sin(x) |
Function | Calculates sine in radians |
cos(x) |
Function | Calculates cosine in radians |
tan(x) |
Function | Calculates tangent in radians |
min(a, b) |
Function | Returns smaller of two numbers |
max(a, b) |
Function | Returns larger of two numbers |
sum(list) |
Function | Sums all numbers in a list |
sqrt(x) |
Function | Calculates square root |
pow(base, exp) |
Function | Calculates exponentiation |
deg_to_rad(deg) |
Function | Converts degrees to radians |
rad_to_deg(rad) |
Function | Converts radians to degrees |
lib:datetime (Date & Time Operations)
- Documentation:
lib/datetime.md
| Class / Function | Description |
|---|---|
now() |
Returns current local DateTime object |
from_timestamp(ts) |
Constructs DateTime from Unix timestamp |
DateTime |
Class representing calendar date/time (supports + TimeDelta) |
TimeDelta |
Class representing time duration in days, hours, minutes, seconds |
lib:path (Object-Oriented Filesystem Path)
- Documentation:
lib/path.md
| Property / Method | Kind | Description |
|---|---|---|
Path(path) |
Class | Object-oriented path (supports / operator joining) |
.name |
Property | Filename with extension |
.stem |
Property | Filename without extension |
.extension |
Property | File extension (e.g. .kyro) |
.parent |
Property | Parent Path object |
.size |
Property | File size in bytes |
.metadata |
Property | Dictionary of full file system metadata |
.exists() |
Method | Checks if path exists |
.is_file() |
Method | Checks if path is a file |
.is_dir() |
Method | Checks if path is a directory |
.read_text() |
Method | Reads file contents as text |
.write_text(txt) |
Method | Overwrites file with text |
.append_text(txt) |
Method | Appends text to file |
.read_dir() |
Method | Returns list of child Path objects |
.glob(pattern) |
Method | Searches directory for matching files |