Modules
The ztcl:: modules are built into ztcl. A module loads with package require, for example package require ztcl::json. A module that reaches the host needs a capability, and only an embedder or a flag of the ztcl program turns it on. Limits and capabilities tells how.
| Module | What it does | Capability | Platforms |
|---|---|---|---|
| ztcl::json | Parses and writes JSON. | none | each target, and WebAssembly |
| ztcl::vt | Keeps the state of a terminal: the cells, the cursor, the modes, and the scrollback. | none | each target, and WebAssembly except ztcl-threads.wasm |
| ztcl::text | Cuts text into grapheme clusters, words, and sentences (Unicode 18), and gives its display width. | none | each target, and WebAssembly |
| ztcl::pdf | Writes PDF files: pages, text in embedded TrueType fonts, images, links, and the outline. | none | each native target |
| ztcl::typeset | Breaks paragraphs into lines with the algorithm of Knuth and Plass, hyphenates words, and lays out Markdown into PDF pages. | none | each native target |
| ztcl::probe | Records the values of a running script at a proc, a line, a command, a variable, or an error, with no change to the script. | none | each target, and the WebAssembly shell (ztcl-shell.wasm) |
| ztcl::disasm | Shows the bytecode of a proc, a lambda, or a script under the source line of each command, and gives ::tcl::unsupported::disassemble. |
none | each target, and the WebAssembly shell (ztcl-shell.wasm) |
| ztcl::wasm | Runs WebAssembly modules, and WASI programs of C, Zig, Rust, or Go, in the limits of the interpreter. | none; file, clock, and random for WASI |
each native target |
| ztcl::tls | Opens a TLS 1.3 connection to a server, as a channel. | socket, channels |
Linux, macOS, x86-64 Windows |
| ztcl::pty | Runs a program on a pseudo-terminal, as a channel. | exec |
Linux, macOS, x86-64 Windows |
| ztcl::watch | Gives the changes of the files below a folder. | file |
Linux, macOS, x86-64 Windows |
| ztcl::open | Opens a URL or a file in the default app of the system. | launch |
macOS, Windows; Linux with a host callback |
| ztcl::notify | Shows a notification of the system. | notify |
macOS; the others with a host callback |
| ztcl::vm | Starts a small Linux guest on the hypervisor of the host. | vm |
macOS |
| ztcl::meter | Counts the compute units, the time, the memory, and the I/O of threads, for billing. | meter |
each target with threads |
| ztcl::gc | Gives the counts of the collector: the pauses, the times, the bytes of the heap, and the resident set. | meter |
each target |
| ztcl::win | The registry, the credentials, and the known folders of Windows. | registry, credential, env |
Windows |
| web | The Web APIs of the page, such as Web Serial, through the table of the Web IDL. | a group of web: in allow |
ztcl-host.wasm in a browser |
| web::bluetooth | The Bluetooth Low Energy devices of Web Bluetooth: GATT services, reads, writes, and notifications. | web:bluetooth in allow |
ztcl-host.wasm in a browser |
| web::gamepad | The game controllers of the Gamepad API: the state, a poll, the events of a new pad, and rumble. | web:gamepad in allow |
ztcl-host.wasm in a browser |
| web::midi | The MIDI ports of Web MIDI: the inputs and outputs, the messages, and notes. | web:midi in allow |
ztcl-host.wasm in a browser |
| web::usb | The USB devices of WebUSB: the endpoints as a channel, and control transfers. | web:usb in allow |
ztcl-host.wasm in a browser |
| web::hid | The HID devices of WebHID: input, output, and feature reports. | web:hid in allow |
ztcl-host.wasm in a browser |
| ztcl::agent | Runs an LLM agent loop in an isolated thread with only the data and the tools of the host. | thread, and socket and channels for the endpoint |
each target with threads |
| ztcl::mac | The keychain and the defaults of macOS. | keychain, defaults |
macOS |
Targets lists the features of each target.