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

FunctionPurposeStatus
print(v)Print a value and a newlineVERIFIED
to_str(v)Convert a value to a stringVERIFIED
len(s)Length of a stringVERIFIED

Concurrency

FunctionPurposeStatus
spawn(fn, arg)Run a function on an OS threadVERIFIED
mutex_new(), lock(m), unlock(m)Mutual exclusionPARTIALLY VERIFIED
chan_new(), chan_send(c, v), chan_recv(c)Channels for message passingPARTIALLY 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

FunctionPurposeStatus
http_get(url)HTTP GET over TCPPARTIALLY 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

FunctionPurposeStatus
json_get(text, key)Read a value from a JSON objectPARTIALLY 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.