Skip to content

wolysh v0.4.0

Choose a tag to compare

@github-actions github-actions released this 04 Oct 10:55
· 85 commits to master since this release
ca66b1e

Superseded by v0.4.1: The v0.4.0 Linux binary can fail with SIGILL on CPUs without the GitHub runner's instruction extensions. Download v0.4.1, which targets baseline x86_64 and includes all v0.4.0 features. The v0.4.0 tag and assets remain unchanged.

wolysh v0.4.0: native parallel tasks and agent workflows

Wolysh 0.4.0 adds native task scheduling, machine-readable results, and syntax
checks for developer tools and agents. It also replaces polling waits with
kernel child events and reduces process-launch allocations and descriptor work.

New features

  • parallel -j N / --jobs N runs independent Wolysh command strings with
    bounded concurrency and immediately refills completed slots. Without a
    limit, it uses the available CPU count, capped by the task count.
  • --fail-fast stops launching queued tasks after observing a failure and
    waits for tasks already started. Each task inherits functions, variables,
    aliases, environment, and working directory; its changes stay isolated.
  • --report path writes JSONL completion and skipped-task records containing
    command, input index, worker PID, exit status, and elapsed milliseconds.
    Reports stay separate from command stdout and stderr.
  • wsh -n / --check validates command strings, scripts, or standard input
    without executing commands, substitutions, or configuration. parallel
    additionally validates all task syntax before starting the batch.
  • Interactive parallel jobs support Ctrl-Z, jobs, bg, fg, and Ctrl-C.

Example for a Wolysh source checkout:

wsh --check examples/demo.wsh
wsh -c "parallel -j 2 --fail-fast --report checks.jsonl 'zig build check' 'zig build -Doptimize=ReleaseFast'"

The batch returns the exit status of the failed started task with the lowest
input index, or 0 when all tasks succeed. Invalid options or task syntax return
2; scheduler and report errors return 1. See the
agent workflow guide
for the full execution and report contract.

Performance and correctness

  • wait -n blocks on kernel child events instead of polling every millisecond,
    honors job and PID operands, and preserves other jobs' completion statuses.
  • Ordinary child launches skip temporary standard-descriptor duplicates when
    the mappings cannot overwrite one another.
  • Environment entries are formatted directly into null-terminated buffers,
    removing one allocation and copy per entry.
  • Waiting for a partially reaped pipeline preserves its last stage's exit
    status, and wait $! can consume an already-reaped background job.
  • A stopped job remains available for resumption after wait returns.
  • Interactive tests wait for the cursor-position sequence before checking
    prompt width, removing a race between separate terminal writes.

Repeatable benchmarks include warmups, 15 interleaved samples, raw timings,
versions, and binary checksums. The
benchmark methodology and results
separate arithmetic tasks from external-command tasks. Results are local
measurements; external build tools, disk, and network time can dominate shell
overhead.

On the recorded Linux x86_64 development machine, v0.4.0 measured 2.05x faster
than Bash at startup, 5.86x faster for the parallel arithmetic workload, and
1.70x faster for parallel /bin/true tasks. The repeated wait -n workload
took about 56% less time than v0.3.5. The arithmetic ratios include Wolysh's
existing interpreter advantage and are not a general build-tool speedup.

Install and upgrade

Download wolysh-v0.4.0-linux-x86_64.tar.gz and its .sha256 file from this
release. In the directory containing both downloads:

sha256sum -c wolysh-v0.4.0-linux-x86_64.tar.gz.sha256
tar -xzf wolysh-v0.4.0-linux-x86_64.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 0755 wolysh-v0.4.0-linux-x86_64/wsh "$HOME/.local/bin/wsh"
"$HOME/.local/bin/wsh" --version

Ensure $HOME/.local/bin is on PATH. For a source build, use Zig 0.16.0:

zig build -Doptimize=ReleaseFast --prefix "$HOME/.local"

The archive includes the executable, MIT license, changelog, examples,
language and agent guides, release notes, and benchmark harness and samples.
Configuration and history paths are unchanged. Non-interactive execution skips
prompt, history, and configuration loading.

Compatibility

Linux x86_64 is the tested and packaged target. Wolysh remains an early-stage
shell with its own scripting language, not a Bash or POSIX drop-in. Existing
Bash scripts should continue to run through Bash. Task output can interleave;
redirect each task to its own log when separate output is needed. Syntax checks
validate source grammar, not command availability or strings later passed to
eval or parallel.

Verification

  • zig build fmt
  • zig build test: 148 unit tests
  • zig build -Doptimize=ReleaseFast
  • python3 tests/pty_test.py: 37 interactive checks
  • python3 tests/shell_compat_test.py: 40 compatibility tests
  • Temporary-prefix installation, release packaging, archive checksums, and
    syntax-check smoke tests

Full changelog