O Language/API/Functions

From OnixOS

Built-in Functions

This page summarizes the current built-in registry in the O Language source repository.

Values and collections

itostr, atostr, getval, type, len, first, last, rest, push, map, replace, and rand operate on values and collections.

Console, files, and data

Console functions include output, input, and inspect. File functions include read, write, remove, mkdir, rmdir, finfo, chmod, exist, wdir, and chdir. Data helpers include json, jsonp, jsonf, xmlp, xmlf, and renderf.

Processes and networking

Process functions include open, run, exec, sh_exec, cmd_exec, proc_out, proc_pid, proc_kill, and sysenv. Networking functions include webserver, sock_send, and sock_listen.

Database

database, model, migrate, fetch, create, update, delete, drop, truncate, query, and search provide database operations. See Database for examples.

Other runtime functions

Other registered helpers include args, colorize, regexp_check, regexp_find, math_sum, math_abs, math_cos, math_sin, math_tan, math_log, encrypt, decrypt, hash_encode, hash_decode, fwatch, asm, quit, and exit.