Channel |
Creates a new channel with the specified capacity. |
List |
Creates a new empty list. |
Map |
Creates a new empty map. |
awaitProcess |
Waits for a spawned process to complete and returns its exit code. Blocks until the process finishes. |
cleanupProcess |
Cleans up resources associated with a completed process. Should be called after awaitProcess. |
contains |
Checks if a string contains a substring. |
fiber_await |
Waits for a fiber to complete and returns its result. |
fiber_spawn |
Spawns a new fiber to execute the given function concurrently. |
fiber_yield |
Yields control to the fiber scheduler with an optional value. |
filter |
Filters elements in an iterator based on a predicate function. |
fold |
Reduces an iterator to a single value by repeatedly applying a function. |
forEach |
Applies a function to each element in an iterator. |
httpCloseClient |
Closes the HTTP client and cleans up resources. |
httpCreateClient |
Creates an HTTP client for making requests to a base URL. |
httpCreateServer |
Creates an HTTP server bound to the specified port and address. |
httpDelete |
Makes an HTTP DELETE request to the specified path. |
httpGet |
Makes an HTTP GET request to the specified path. |
httpListen |
Starts the HTTP server listening for requests with a handler function. |
httpPost |
Makes an HTTP POST request with a request body. |
httpPut |
Makes an HTTP PUT request with a request body. |
httpRequest |
Makes a generic HTTP request with any method. |
httpStopServer |
Stops the HTTP server and closes all connections. |
input |
Reads a string from the user’s input. |
join |
Joins a list of strings with a separator. |
length |
Returns the length of a string. |
map |
Transforms each element in an iterator using a function, returning a new iterator. |
parseInt |
Parses a string to an integer, returns error if parsing fails. |
print |
Prints a value to the console. Automatically converts the value to a string representation. |
range |
Creates an iterator that generates numbers from start to end (exclusive). |
readFile |
Reads the entire contents of a file as a string. |
recv |
Receives a value from a channel. |
send |
Sends a value to a channel. Returns 1 for success, 0 for failure. |
sleep |
Pauses execution for the specified number of milliseconds. |
spawnProcess |
Spawns an external async process with MANDATORY callback for stdout/stderr capture. The callback function receives (processID: int, eventType: int, data: string) and is called for stdout (1), stderr (2), and exit (3) events. Returns a handle for the running process. CALLBACK IS REQUIRED - NO FUNCTION OVERLOADING! |
substring |
Extracts a substring from start to end index, or returns an error if indices are invalid. |
toString |
Converts a value to its string representation. |
websocketClose |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<Success, String>. Closes the WebSocket connection and cleans up resources. |
websocketConnect |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<WebSocketID, String> and takes string handler instead of function pointer. Establishes a WebSocket connection with a message handler callback. |
websocketCreateServer |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<ServerID, String> and has critical runtime issues with port binding failures. Creates a WebSocket server bound to the specified port, address, and path. |
websocketKeepAlive |
⚠️ SPEC VIOLATION: Current implementation returns int instead of Unit. Keeps the WebSocket server running indefinitely until interrupted (blocking operation). |
websocketSend |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<Success, String>. Sends a message through the WebSocket connection. |
websocketServerBroadcast |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t (number of clients sent to) instead of Result<Success, String>. Broadcasts a message to all connected WebSocket clients. |
websocketServerListen |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<Success, String> and currently returns -4 (bind failed) due to port binding issues. Starts the WebSocket server listening for connections. |
websocketStopServer |
⚠️ SPEC VIOLATION: Current implementation returns raw int64_t instead of Result<Success, String>. Stops the WebSocket server and closes all connections. |
writeFile |
Writes content to a file. Creates the file if it doesn’t exist. |