Standard Library
This reference lists built-ins confirmed against the shipped RUDRA 1.1.0 binary. Function names and statuses are accurate to the release; see Transparency for the evidence.
Core
| Function | Purpose | Status |
|---|---|---|
print(v) | Print a value and a newline | VERIFIED |
to_str(v) | Convert a value to a string | VERIFIED |
len(s) | Length of a string | VERIFIED |
Concurrency
| Function | Purpose | Status |
|---|---|---|
spawn(fn, arg) | Run a function on an OS thread | VERIFIED |
mutex_new(), lock(m), unlock(m) | Mutual exclusion | PARTIALLY VERIFIED |
chan_new(), chan_send(c, v), chan_recv(c) | Channels for message passing | PARTIALLY VERIFIED |
fn worker(x: int) {
print(x);
}
fn main() {
spawn(worker, 42);
let c = chan_new();
chan_send(c, 7);
print(chan_recv(c));
} API note
The channel functions are chan_send and chan_recv. Functions named send and recv do not exist in the shipped binary.
Networking
| Function | Purpose | Status |
|---|---|---|
http_get(url) | HTTP GET over TCP | PARTIALLY VERIFIED |
Networking limits
http_get opens a real TCP connection but requires a numeric IP address. Hostname resolution (DNS) is not implemented, and HTTPS/TLS is not implemented.
JSON
| Function | Purpose | Status |
|---|---|---|
json_get(text, key) | Read a value from a JSON object | PARTIALLY VERIFIED |
fn main() {
print(json_get("{\"a\": 42}", "a"));
} API note
A function named json_parse does not exist in the shipped binary. JSON object reading is done with json_get.
Time
Time builtins hour, minute, second and year are documented in the release notes.