Output and Diagnostics

pub fn assert(test: boolean, message: text, file: text, line: integer)

Panics with message if test is false. Use to verify invariants during development. In production mode (--production), logs an error instead of aborting. The file and line are injected by the compiler; do not pass them manually. Safe to call from par workers: failures write to the log/stderr sink, which the host serialises across threads.

pub fn panic(message: text, file: text, line: integer)

Immediately terminates execution with message. Use for unrecoverable error states. In production mode (--production), logs a fatal entry and execution continues. The file and line are injected by the compiler; do not pass them manually.

pub fn exit(code: integer) process#update

Ends the program at once with exit status code, as a shell's exit does: what was printed is flushed, nothing more is printed, and no diagnostic names the line — a script's verdict is its own, where assert and panic answer loft's (status 1 and a message). Under loft test it ends the test instead, as a failure that names the code.

pub fn log_info(message: text, file: text, line: integer) io#append

Write a structured log record at the chosen severity. The file and line are injected by the compiler; do not pass them manually. Safe to call from par workers: the host serialises log writes across threads.

pub fn log_warn(message: text, file: text, line: integer) io#append

Like log_info, at warning severity.

pub fn log_error(message: text, file: text, line: integer) io#append

Like log_info, at error severity.

pub fn log_fatal(message: text, file: text, line: integer) io#append

Like log_info, at fatal severity.

pub fn print(v1: text) io#append

Writes v to standard output without a newline. Use for progress output and building up a line incrementally.

pub fn println(v1: text) io#append

Writes v followed by a newline. The standard choice for line-oriented output.

pub fn eprint(v1: text) io#append

Writes v to standard ERROR without a newline. Companion to print() — use to separate human-readable status / progress / summary lines from machine-readable stdout (JSON, structured data piped to downstream consumers).

pub fn eprintln(v1: text) io#append

Writes v followed by a newline to standard ERROR.

pub fn len(self: const spatial) -> integer

Number of elements in a spatial (radix / Morton tree) collection.

pub fn size(self: const spatial) -> integer

The byte footprint of a spatial index: its tree's node array, room included. Allocation-local, as size of a hash: the element records are not counted. 0 for an empty (unallocated) one.

pub fn len(self: const trie) -> integer

Number of elements in the trie.

pub fn size(self: const trie) -> integer

The byte footprint of a trie: its tree's node array, room included. Allocation-local, as size of a hash: the element records are not counted. 0 for an empty (unallocated) one.