Sigil 0.22.0

release

A scripting and reliability release. Sigil is more convenient for operational scripts, the bundled client supports TLS 1.3, and builds and sockets recover more reliably from cache and resource problems. Direct file execution now provides the scripting prelude automatically; ordinary evaluation remains available through sigil eval -f.

Download 0.22.0Get started

No dependency-wide version bumps are required. A declaration such as sigil: "0.21" already admits 0.22.0, but sigil deps install preserves a valid locked runtime. Upgrading the CLI does not rewrite project lockfiles. Projects that start using the new runtime or standard-library APIs should raise their minimum to sigil: "0.22" and run sigil deps install. To refresh dependencies and explicitly move the runtime within the existing compatibility window, use sigil deps update --upgrade-sigil; this also updates ordinary dependencies.

TLS 1.3 and connection diagnostics

The bundled TLS client now supports TLS 1.3 alongside TLS 1.2, using Mbed TLS 3.6.7. Certificate and hostname verification remain enabled. New tls-connect/details and tls-upgrade/details procedures expose per-attempt handshake failures and negotiated protocol details; existing connection APIs keep their behavior.

A scripting prelude and reliable command capture

sigil script.sgl now loads (sigil shell prelude), including short text/path names, positional arguments, iteration, polling, and temporary-directory scopes. sigil eval -f file.sgl keeps ordinary explicit imports; sigil eval --quiet suppresses implicit expression results. See the shell scripting guide.

Unix command capture drains both output streams while feeding stdin, fixing stalls when output fills a pipe. Background commands can write directly to log files and explicitly detach from the launching script. Unsupported options now fail before spawning. File/directory scopes clean up when their body raises, and printing to a closed port raises instead of crashing.

Shebang scripts work with formatter verification and strict test classification. Reader errors retain the source filename. Concurrent auto-compilation uses unique staging files, and failed cache refreshes stop execution instead of loading stale bytecode.

Script and eval errors now show concise diagnostics on stderr, with expanded call history available through --error-history. The guide includes a complete HTTP harness with child cleanup and retained failure evidence, and explains how polling deadlines interact with blocking readiness probes.

Shared text and iteration helpers

(sigil string) adds string-truncate, with a configurable truncation marker, and string-contains-any? for literal alternatives. (sigil iteration) adds each for lists and arrays, and (sigil time) adds wait-until for readiness polling. These helpers are also available in the scripting prelude.

read-file-string, also exposed as read-text in scripts, reads complete UTF-8 files without truncating multibyte text. Its new missing: and trim: options cover optional state files and whitespace trimming without hiding permission or other read errors.

Cached builds retain API documentation

Restoring compiled modules from the build store now restores their documentation metadata too, keeping help, editor navigation, and MCP documentation available after a cache hit. When a second checkout reuses that cache, source locations are updated to point into the current checkout. Missing or unusable metadata causes recompilation instead of leaving an incomplete cache result in place.

Socket polling under descriptor exhaustion

On systems using epoll or kqueue, socket polling falls back to poll when the process or system cannot allocate another file descriptor. Applications can continue draining and closing existing sockets, including high-numbered descriptors, so they can recover from that condition.

The async scheduler rounds future fractional-millisecond deadlines up when polling, avoiding a busy loop while waiting for the timer to expire.

WebSocket event notifications for browser hosts

The WebAssembly network bridge accepts an optional onEvent(socketId, eventType) callback when creating imports or opening a WebSocket directly. Hosts can wake their event loop when a connection, message, error, or close event is queued. The existing event queue remains available, and a callback exception does not discard the event.

Updated bundled libraries

The CLI now bundles HTTP 0.18.7, log 0.17.0, nREPL 0.17.2, MCP 0.18.0, SQLite 0.16.3, and LSP 0.16.3 alongside crypto 0.16.6 and TLS 0.16.7. The MCP transition pin is replaced by its published release. The refreshed dependency graph no longer locks the retired standalone socket, docs, and ANSI providers.

Text log fields now quote and escape unsafe values; JSON log output is unchanged. Requesting dependency-subcommand help no longer starts an install or upgrade. The updated HTTP library also includes byte-preserving uploads, streamed responses, and multipart file parsing.