comments Using comments in codeif then elseif else end Conditional statementsend Block terminator keywordand or not Logical AND, OR, and NOTfor in Loop with iterationwhile do Loop while condition is truebreak Exit loop earlycontinue Skip to next iterationtry Try-catch error handlingcatch() Catch errors from try blockthrow(msg) Throw an error with call stack informationarray Ordered list of valuesbinary Immutable binary data (files, images, etc.)boolean True or falsecode Pre-parsed source code valueerror Error value with message and stack tracenil Null/undefined valuenumber Floating-point numberobject Key-value data structurestring Text valuecontains(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 stringlen(value) Get the length of arrays, objects, or stringslower(str) Convert to lowercaserepeat(str, count) Repeat string multiple timesstarts_with(str, prefix) Check if string starts with prefixends_with(str, suffix) Check if string ends with suffixreplace(str, pattern, replacement) Replace all matches of pattern with replacement string or function result (supports regex)split(str, sep) Split string into array by separatorsubstr(str, pos, length) Get text, supports negative lengthtemplate(str) Create reusable template function from string with {{expression}} syntaxtrim(str) Remove leading and trailing whitespaceupper(str) Convert to uppercasedeep_copy(value) Deep copy of arrays/objects; functions removed (safety for scope boundaries)filter(array, fn) Keep only elements matching predicatekeys(obj) Get array of all object keysmap(array, fn) Transform each element with functionpop(array) Remove and return last elementpush(array, values...) Add elements to end, returns new lengthrange(start, end, step) Create array of numbers in sequencereduce(array, fn, init) Combine array into single valueshift(array) Remove and return first elementsort(array, fn) Sort array in ascending orderunshift(array, values...) Add elements to beginning, returns new lengthvalues(obj) Get array of all object valuesabs(n) Absolute valueceil(n) Round up to nearest integerclamp(val, min, max) Constrain value between min and maxfloor(n) Round down to nearest integermax(nums...) Find maximum valuemin(nums...) Find minimum valuepow(base, exp) Raise to power (exponentiation)random() Get random float between 0 and 1 (seeded per invocation)round(n) Round to nearest integersqrt(n) Square rootacos(x) Inverse cosine (arccosine), x between -1 and 1, returns radiansasin(x) Inverse sine (arcsine), x between -1 and 1, returns radiansatan(x) Inverse tangent (arctangent), returns radiansatan2(y, x) Inverse tangent with quadrant correction, returns radianssin(angle) Sine of angle in radianscos(angle) Cosine of angle in radianstan(angle) Tangent of angle in radiansexp(x) E raised to the power xlog(x) Logarithm base 10ln(x) Natural logarithm (base e)pi() Mathematical constant π (3.14159…)load(path) Read file contents as stringload_binary(path) Read file as immutable binary datasave(path, content) Write string to file (create/overwrite)save_binary(binary, path) Write binary data to fileappend_file(path, content) Append content to file (create if needed)copy_file(src, dst) Copy file (supports /EMBED/ for embedded files)move_file(src, dst) Move file from source to destinationrename_file(old, new) Rename or move a fileremove_file(path) Delete a filelist_dir(path) List directory contents with {name, is_dir}list_files(path) List files in directory recursivelymake_dir(path) Create directory (including parent directories)remove_dir(path) Remove empty directoryfile_exists(path) Check if file or directory existsfile_type(path) Get file type (“file” or “directory”)current_dir() Get current working directorywatch(path, timeout) Monitor file or directory for changesfetch(url, options) Make HTTP requests (JavaScript-style fetch API)http_server(config) Create HTTP server for handling requestsinput(prompt) Read line from stdin, optionally display promptprint(values...) Output values to stdout, separated by spaceswrite(values...) Output values to stdout without newline at the endbusy(message) Display a loading/busy message to stderrformat_time(timestamp, format) Format timestamp to stringnow() Get current Unix timestamp in local timezonetimestamp(timezone) Get current Unix timestamp in UTC or a specific timezone/offsettimer() Get current time with sub-second precision for benchmarkingparse_time(str, format) Parse time string to timestampsleep(duration) Pause execution for duration in seconds (default: 1)encode_base64(str|binary) Encode string or binary to base64decode_base64(str) Decode base64 string to binaryformat_json(value, indent) Convert value to JSON string (stringifies binary, functions, errors)parse_json(str) Parse JSON stringmarkdown_html(text, options) Render markdown to HTMLmarkdown_ansi(text, theme) Render markdown to ANSI terminal output with colorsmarkdown_text(text) Render markdown to plain textinclude(path) Execute script in current scoperequire(path) Load module in isolated scope, return exportstobool(value) Convert to booleantonumber(value) Convert to numbertostring(value) Convert to stringtype(value) Get type name of variablecontext() Get runtime context for a scripts or nil if unavailableexit(value) Exit script with optional return valueparallel(fns) Execute functions concurrentlyparse(source, metadata) Parse code string into code or error value (never throws)run(script, context) Execute script synchronously and return resultspawn(script, context) Run script in background goroutine and return numeric process IDkill(pid) Terminate a spawned process by PIDbreakpoint(args...) Pause execution and enter debug mode (enable with -debug)watch(exprs...) Monitor expression values and break on changes (enable with -debug)throw(msg) Throw an error with call stack informationassert(condition, message) Check a condition and throw an error if falsesql(namespace, config) Create or retrieve a MySQL-compatible database connection pooldatastore(namespace, config) Access a named thread-safe in-memory key/value store with optional persistencesys(key) Access system information and CLI configuration valuesdoc(topic) Access documentation for modules and builtinsenv(name) Read environment variableuuid() Generate RFC 9562 UUID v7 (time-ordered, sortable unique identifier)hash(algo, data) Compute cryptographic hash of string or binary (sha256, sha512, sha1, md5)hash_password(password, cost) Hash password with bcrypt for secure storageverify_password(password, hash) Verify password against bcrypt hashsign_rsa(data, private_key_pem) Sign data with RSA private key (SHA256-PKCS1v15)verify_rsa(data, signature, public_key_pem) Verify RSA signaturersa_from_jwk(n, e) Convert JWK modulus and exponent to PEM-encoded RSA public keysign_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)Learn about Embedding Duso in your Go applications.