Documentation
Getting Started
Guides
Libraries
Standard Library (stdlib)
- ansi ANSI color and terminal styling utilities
- docserver Embedded documentation server with caching
- azure-ai Azure OpenAI API for accessing GPT-4, Claude, and other hosted models
- claude Anthropic Claude API integration with multi-turn conversations and tools
- couchdb CouchDB database client with CRUD operations and Mango queries
- deepseek DeepSeek LLM API idiomatic interface
- gemini Google Gemini API with OpenAI-compatible interface
- grok xAI Grok LLM API with OpenAI-compatible interface
- groq Groq ultra-fast inference API
- ollama Local LLMs through Ollama’s OpenAI-compatible API
- openai OpenAI API with options-based interface
- phospher Phospher Icons SVG inline icon fetcher
- stripe Stripe payment processing API
- svgraph SVG chart and graph generation
- zlm “Zero Language Model” for testing LLM-scale scenarios without burning tokens
Language Keywords
Variables
var Variable declaration
raw Raw string/template modifier
Syntax
Logic
Loops
Functions
Exceptions
try Try-catch error handling
catch() Catch errors from try block
throw(msg) Throw an error with call stack information
Types
array Ordered list of values
binary Immutable binary data (files, images, etc.)
boolean True or false
code Pre-parsed source code value
error Error value with message and stack trace
nil Null/undefined value
number Floating-point number
object Key-value data structure
string Text value
Built-in Functions
Strings
contains(str, pattern) Check if contains pattern (supports regex)
find(str, pattern) Find all matches, returns array of {text, pos, len} objects (supports regex)
join(array, sep) Join array elements into single string
len(value) Get the length of arrays, objects, or strings
lower(str) Convert to lowercase
pad_left(str, width, char) Pad on the left to reach desired width
pad_right(str, width, char) Pad on the right to reach desired width
repeat(str, count) Repeat string multiple times
starts_with(str, prefix) Check if string starts with prefix
ends_with(str, suffix) Check if string ends with suffix
replace(str, pattern, replacement) Replace all matches of pattern with replacement string or function result (supports regex)
split(str, sep) Split string into array by separator
substr(str, pos, length) Get text, supports negative length
template(str) Create reusable template function from string with {{expression}} syntax
trim(str) Remove leading and trailing whitespace
upper(str) Convert to uppercase
Arrays & Objects
deep_copy(value) Deep copy of arrays/objects; functions removed (safety for scope boundaries)
filter(array, fn) Keep only elements matching predicate
keys(obj) Get array of all object keys
map(array, fn) Transform each element with function
pop(array) Remove and return last element
push(array, values...) Add elements to end, returns new length
range(start, end, step) Create array of numbers in sequence
reduce(array, fn, init) Combine array into single value
shift(array) Remove and return first element
sort(array, fn) Sort array in ascending order
unshift(array, values...) Add elements to beginning, returns new length
values(obj) Get array of all object values
Math
abs(n) Absolute value
ceil(n) Round up to nearest integer
clamp(val, min, max) Constrain value between min and max
floor(n) Round down to nearest integer
max(nums...) Find maximum value
min(nums...) Find minimum value
pow(base, exp) Raise to power (exponentiation)
random() Get random float between 0 and 1 (seeded per invocation)
round(n) Round to nearest integer
sqrt(n) Square root
acos(x) Inverse cosine (arccosine), x between -1 and 1, returns radians
asin(x) Inverse sine (arcsine), x between -1 and 1, returns radians
atan(x) Inverse tangent (arctangent), returns radians
atan2(y, x) Inverse tangent with quadrant correction, returns radians
sin(angle) Sine of angle in radians
cos(angle) Cosine of angle in radians
tan(angle) Tangent of angle in radians
exp(x) E raised to the power x
log(x) Logarithm base 10
ln(x) Natural logarithm (base e)
pi() Mathematical constant π (3.14159…)
File I/O
Image Processing
load_image(path) Load image from file
save_image(image, path) Save image to file
scale_image(image, max_x, max_y, mode) Scale image with fit/fill/stretch modes
crop_image(image, x, y, width, height) Extract rectangular region from image
rotate_image(image, degrees) Rotate by 90, 180, or 270 degrees
flip_image_x(image) Flip horizontally (left-right mirror)
flip_image_y(image) Flip vertically (top-bottom mirror)
grayscale_image(image) Convert to grayscale
convert_image(image, format) Convert between PNG, JPEG, and GIF formats
composite_image(base, overlay, x, y, blend) Layer overlay on base with blend modes
set_image_opacity(image, opacity) Set absolute opacity (0.0-1.0)
adjust_image_opacity(image, factor) Multiply opacity by factor
Network & HTTP
I/O
Date & Time
Encoding
Modules
Types
Flow & Concurrency
Debugging
Testing
System & Data Storage
sql(namespace, config) Create or retrieve a MySQL-compatible database connection pool
datastore(namespace, config) Access a named thread-safe in-memory key/value store with optional persistence
sys(key) Access system information and CLI configuration values
doc(topic) Access documentation for modules and builtins
env(name) Read environment variable
uuid() Generate RFC 9562 UUID v7 (time-ordered, sortable unique identifier)
Security
hash(algo, data) Compute cryptographic hash of string or binary (sha256, sha512, sha1, md5)
hash_password(password, cost) Hash password with bcrypt for secure storage
verify_password(password, hash) Verify password against bcrypt hash
sign_rsa(data, private_key_pem) Sign data with RSA private key (SHA256-PKCS1v15)
verify_rsa(data, signature, public_key_pem) Verify RSA signature
rsa_from_jwk(n, e) Convert JWK modulus and exponent to PEM-encoded RSA public key
sign_ec(data, private_key_pem) Sign data with EC private key (ES256, P-256 curve)
verify_ec(data, signature, public_key_pem) Verify EC signature (ES256, P-256 curve)
ec_from_jwk(x, y) Convert JWK x,y coordinates to PEM-encoded EC public key (P-256)