v. vanilla 2.0
THE VANILLA HANDBOOK / 2.0

Function & command index

Every built-in command and math function, from A to Z.

Every built-in, in one place

This A–Z index covers built-in commands, their subcommands, structural keywords and the eight math expression functions. User-defined functions have application-specific names and are called with call $dest name ... or directly as name ....

Syntax uses descriptive placeholders: declare $dest variables first; optional operands are in brackets. This is a syntax index, not a collection of standalone runnable programs. Open each guide for value types, permissions, error behavior and limits. Unsupported historical dll, dllimport and cgi commands are not APIs; web hosting uses the separate CGI gateway.

137 entries · Alphabetically sorted · Filter by name, purpose or category

137 entries

abs()

Math expression functions

abs(x)

Absolute value. Use inside math expressions.

Full reference →

args all

Structured data and utilities

args all $array

Collect script arguments into a string array.

Full reference →

args count

Structured data and utilities

args count $dest

Count script CLI arguments.

Full reference →

args get

Structured data and utilities

args get $dest index

Read a zero-based script argument.

Full reference →

array create

Core language

array create $array [value ...]

Create a native string array.

Full reference →

array get

Core language

array get $dest $array index

Read a zero-based item.

Full reference →

array len

Core language

array len $dest $array

Count array items.

Full reference →

array pop

Core language

array pop $dest $array

Remove and return the last item.

Full reference →

array push

Core language

array push $array value

Append a string item.

Full reference →

array set

Core language

array set $array index value

Replace an existing item.

Full reference →

assert

Iteration, local data and tests

assert left operator right

Fail if a comparison is false.

Full reference →

break

Core language

break

Exit the nearest loop.

Full reference →

call

Core language

call $dest name arg ...

Call a user-defined function and capture its result.

Full reference →

catch

Structured data and utilities

catch $error

Capture an ordinary runtime error.

Full reference →

ceil()

Math expression functions

ceil(x)

Round up. Use inside math expressions.

Full reference →

clock

Core language

clock $dest

Read elapsed monotonic milliseconds.

Full reference →

continue

Core language

continue

Advance the nearest loop.

Full reference →

csv parse

Iteration, local data and tests

csv parse $rows $text

Parse CSV into JSON arrays of strings.

Full reference →

csv stringify

Iteration, local data and tests

csv stringify $text $rows

Serialize string rows as CSV.

Full reference →

date diff

Iteration, local data and tests

date diff $seconds $end_epoch $start_epoch

Subtract integral epoch seconds.

Full reference →

date format

Iteration, local data and tests

date format $text $epoch zone

Format an epoch in UTC or a fixed offset.

Full reference →

date parse

Iteration, local data and tests

date parse $epoch text zone

Parse a strict civil date with an explicit zone.

Full reference →

db begin

Iteration, local data and tests

db begin $handle

Begin a nonnested SQLite transaction.

Full reference →

db close

Iteration, local data and tests

db close $handle

Close SQLite and roll back pending work.

Full reference →

db commit

Iteration, local data and tests

db commit $handle

Commit a SQLite transaction.

Full reference →

db exec

Iteration, local data and tests

db exec $changed $handle sql $params

Execute one non-row-returning prepared statement.

Full reference →

db open

Iteration, local data and tests

db open $handle path

Open a SQLite database.

Full reference →

db query

Iteration, local data and tests

db query $rows $handle sql $params

Execute one read-only, row-returning prepared statement.

Full reference →

db rollback

Iteration, local data and tests

db rollback $handle

Roll back a SQLite transaction.

Full reference →

do

Core language

do

Start a post-test loop.

Full reference →

echo

Core language

echo value ...

Alias of print.

Full reference →

else

Core language

else

Start the alternate branch of an if.

Full reference →

end for

Core language

end for

Close a numeric loop.

Full reference →

end foreach

Iteration, local data and tests

end foreach

Close snapshot iteration.

Full reference →

end if

Core language

end if

Close an if block.

Full reference →

end loop

Core language

end loop

Close a pre-test loop.

Full reference →

end try

Structured data and utilities

end try

Close an error handler.

Full reference →

env get

Core language

env get $dest NAME

Read an overlay or inherited environment value.

Full reference →

env set

Core language

env set NAME value

Set a script-local environment overlay value.

Full reference →

exit

Core language

exit

End the entire script.

Full reference →

file append

Structured data and utilities

file append path text

Append to a file.

Full reference →

file close

Structured data and utilities

file close handle

Close a streaming reader.

Full reference →

file copy

Structured data and utilities

file copy source destination

Copy without replacing an existing destination.

Full reference →

file create

Iteration, local data and tests

file create path text

Create a new file without clobbering an existing path.

Full reference →

file exists

Structured data and utilities

file exists $dest path

Test filesystem entry existence.

Full reference →

file list

Structured data and utilities

file list $array directory

List sorted directory entry names.

Full reference →

file open

Structured data and utilities

file open $handle path

Open a regular file for streaming reads.

Full reference →

file read

Structured data and utilities

file read $dest path

Read a bounded regular file.

Full reference →

file readline

Structured data and utilities

file readline $line $eof handle

Read the next bounded file line.

Full reference →

file rename

Structured data and utilities

file rename source destination

Rename without replacing an existing destination.

Full reference →

file write

Structured data and utilities

file write path text

Write a file, truncating existing contents.

Full reference →

find

Core language

find $dest text needle

Find first byte offset, or -1.

Full reference →

floor()

Math expression functions

floor(x)

Round down. Use inside math expressions.

Full reference →

for

Core language

for $i start end [step]

Iterate a numeric range with exclusive end.

Full reference →

foreach

Iteration, local data and tests

foreach $value $source

Iterate a snapshot; optional key destination precedes value.

Full reference →

function

Core language

function name argc

Declare a function; named parameters are also supported.

Full reference →

goto

Core language

goto label

Jump to an already visited point in the same scope.

Full reference →

http get

Structured data and utilities

http get $body $status url timeout_ms max_response_bytes

Make a bounded HTTP/S GET.

Full reference →

http post

Structured data and utilities

http post $body $status url timeout_ms max_response_bytes request_body

Make a bounded HTTP/S POST.

Full reference →

if

Core language

if left operator right

Start a conditional block.

Full reference →

include

Core language

include path

Load function definitions from another source file.

Full reference →

input

Structured data and utilities

input $line $eof

Read a line from standard input.

Full reference →

join

Core language

join $dest $array delimiter

Join native string array elements.

Full reference →

json get

Structured data and utilities

json get $dest $json keyOrIndex

Read a JSON member or array item.

Full reference →

json parse

Structured data and utilities

json parse $dest text

Parse typed JSON.

Full reference →

json string

Structured data and utilities

json string $dest text

Wrap scalar text as a JSON string.

Full reference →

json stringify

Structured data and utilities

json stringify $dest $json

Encode a JSON value as text.

Full reference →

json text

Structured data and utilities

json text $dest $json

Extract a primitive JSON value as scalar text.

Full reference →

json type

Structured data and utilities

json type $dest $json

Report the JSON type.

Full reference →

kill

Core language

kill name

End a function declaration.

Full reference →

len

Core language

len $dest text

Return byte length.

Full reference →

loop

Core language

loop left operator right

Start a pre-test loop.

Full reference →

lower

Core language

lower $dest text

Convert ASCII letters to lowercase.

Full reference →

map create

Structured data and utilities

map create $map

Create an empty JSON object.

Full reference →

map get

Structured data and utilities

map get $dest $map key

Read an object member.

Full reference →

map has

Structured data and utilities

map has $dest $map key

Test object membership.

Full reference →

map keys

Structured data and utilities

map keys $array $map

List sorted keys as a string array.

Full reference →

map remove

Structured data and utilities

map remove $map key

Remove an object member.

Full reference →

map set

Structured data and utilities

map set $map key value

Add or replace an object member.

Full reference →

math

Core language

math $dest expression

Evaluate a finite numeric expression.

Full reference →

max()

Math expression functions

max(a,b)

Maximum of two values. Use inside math expressions.

Full reference →

min()

Math expression functions

min(a,b)

Minimum of two values. Use inside math expressions.

Full reference →

point

Core language

point label

Record a visited jump point.

Full reference →

pow()

Math expression functions

pow(a,b)

Raise a to power b. Use inside math expressions.

Full reference →

print

Core language

print value ...

Write values without an implicit newline.

Full reference →

random

Core language

random $dest low high

Generate a non-cryptographic integer in an inclusive range.

Full reference →

random seed

Core language

random seed integer

Seed the deterministic random generator.

Full reference →

replace

Core language

replace $dest text needle replacement

Replace nonoverlapping matches.

Full reference →

return

Core language

return value ...

Return concatenated scalar text.

Full reference →

returnvalue

Iteration, local data and tests

returnvalue value

Return a value while preserving its type.

Full reference →

round()

Math expression functions

round(x)

Round halfway away from zero. Use inside math expressions.

Full reference →

set

Core language

set $dest value ...

Concatenate scalar values into a destination.

Full reference →

socket accept

Stream networking

socket accept $connection $listener timeout_ms

Accept an incoming stream.

Full reference →

socket close

Stream networking

socket close $connection

Close a stream or listener.

Full reference →

socket connect

Stream networking

socket connect $connection host port timeout_ms

Connect a TCP stream.

Full reference →

socket endpoint

Stream networking

socket endpoint $address $port $connection

Read the local endpoint.

Full reference →

socket handshake

Nonblocking networking and UDP

socket handshake $result $connection

Advance a server TLS handshake.

Full reference →

socket listen

Stream networking

socket listen $listener address port backlog

Create a TCP listener.

Full reference →

socket readline

Stream networking

socket readline $data $eof $connection maxbytes timeout_ms

Receive a bounded line.

Full reference →

socket recv

Stream networking

socket recv $data $eof $connection maxbytes timeout_ms

Receive stream bytes.

Full reference →

socket sendall

Stream networking

socket sendall $connection data timeout_ms

Send all bytes within the bounded operation.

Full reference →

socket tlsconnect

Stream networking

socket tlsconnect $connection host port timeout_ms

Connect with verified TLS.

Full reference →

socket tlslisten

Nonblocking networking and UDP

socket tlslisten $listener address port backlog

Create a TLS listener using operator credentials.

Full reference →

socket tryaccept

Nonblocking networking and UDP

socket tryaccept $result $connection $listener handshake_ms

Attempt a nonblocking accept.

Full reference →

socket tryrecv

Nonblocking networking and UDP

socket tryrecv $result $data $connection maxbytes

Attempt a nonblocking read.

Full reference →

socket trysend

Nonblocking networking and UDP

socket trysend $result $connection data

Attempt or resume a nonblocking write.

Full reference →

socket wait

Nonblocking networking and UDP

socket wait $events $interests timeout_ms

Wait for readiness on selected handles.

Full reference →

split

Core language

split $array text delimiter

Split into a native string array.

Full reference →

sql begin

Remote SQL

sql begin $handle

Begin a remote transaction.

Full reference →

sql close

Remote SQL

sql close $handle

Close the connection and roll back ordinary pending work.

Full reference →

sql commit

Remote SQL

sql commit $handle

Commit a remote transaction.

Full reference →

sql exec

Remote SQL

sql exec $affected $handle sql $params

Execute a prepared non-row-returning statement.

Full reference →

sql open

Remote SQL

sql open $handle driver profile-name

Open a mysql, mariadb or mssql profile.

Full reference →

sql query

Remote SQL

sql query $rows $handle sql $params

Execute a prepared row-returning statement; not a read-only guarantee.

Full reference →

sql rollback

Remote SQL

sql rollback $handle

Roll back a remote transaction.

Full reference →

sqrt()

Math expression functions

sqrt(x)

Square root. Use inside math expressions.

Full reference →

substr

Core language

substr $dest text start length

Extract a byte-based substring.

Full reference →

trim

Core language

trim $dest text

Remove surrounding ASCII whitespace.

Full reference →

try

Structured data and utilities

try

Begin a recoverable-error handler.

Full reference →

udp bind

Nonblocking networking and UDP

udp bind $handle address port

Bind a UDP socket.

Full reference →

udp close

Nonblocking networking and UDP

udp close $handle

Close a UDP socket.

Full reference →

udp endpoint

Nonblocking networking and UDP

udp endpoint $address $port $handle

Read a UDP local endpoint.

Full reference →

udp recvfrom

Nonblocking networking and UDP

udp recvfrom $result $data $handle maxbytes

Receive a datagram and metadata.

Full reference →

udp sendto

Nonblocking networking and UDP

udp sendto $result $handle address port data

Send a datagram.

Full reference →

upper

Core language

upper $dest text

Convert ASCII letters to uppercase.

Full reference →

var

Core language

var name ...

Declare local variables.

Full reference →

web escape

CGI response API

web escape $dest text

Escape text for HTML output.

Full reference →

web header

CGI response API

web header name value

Set a validated response header.

Full reference →

web request

CGI response API

web request $dest

Read structured CGI request data in worker mode.

Full reference →

web status

CGI response API

web status code

Set the buffered HTTP response status.

Full reference →

websocket abort

WebSockets

websocket abort $connection

Immediately release a WebSocket connection.

Full reference →

websocket client

WebSockets

websocket client $result $connection $config timeout_ms

Begin a client upgrade on an established stream.

Full reference →

websocket close

WebSockets

websocket close $result $connection code reason timeout_ms

Begin a bounded closing handshake.

Full reference →

websocket send

WebSockets

websocket send $result $connection type data

Queue text, binary or ping data.

Full reference →

websocket server

WebSockets

websocket server $result $connection $config timeout_ms

Begin a server upgrade on an established stream.

Full reference →

websocket step

WebSockets

websocket step $result $data $connection

Advance handshake, messages or closing.

Full reference →

while

Core language

while left operator right

Close and test a do loop.

Full reference →