Repository navigation
Releases: dev-dami/wolysh
Release list
wolysh v0.5.0
wolysh v0.5.0: Bash compatibility
Wolysh 0.5.0 implements most of Bash's scripting language. Control flow,
[[ ]] and (( )), parameter expansion and arrays, redirections and process
substitution, strict mode and traps, and the Bash builtins scripts depend on
now behave as they do in Bash 5.3. The test suite runs each of these areas in
both shells and compares the results.
Highlights
#!/usr/bin/env wsh
set -euo pipefail
trap 'echo "failed at line $LINENO" >&2' ERR
declare -A sizes=()
while IFS= read -r -d '' file; do
[[ $file =~ \.([a-z]+)$ ]] || continue
(( sizes[${BASH_REMATCH[1]}] += $(stat -c %s "$file") ))
done < <(find src -type f -print0)
for ext in "${!sizes[@]}"; do
case $ext in
zig|py) printf '%-4s %8d bytes\n' "$ext" "${sizes[$ext]}" ;;
esac
done- Control flow:
if/elif/fi,casewith;∧;&,until,
select, POSIX function definitions,local,time,[[ ]](patterns,
=~withBASH_REMATCH, integer and file tests),(( ))and
for (( init; test; step )). - Expansion:
${var:=},${var:?},${var#pat},${var/pat/rep},
${var:off:len}, case modification,${!name}; indexed and associative
arrays;declare/typesetattributes; Bash integer arithmetic in$(( )). - Redirection and quoting:
execredirections,{fd}>file,<>,>|,
<( )and>( ),$'...', extended globbing. - Strict mode:
set -euo pipefail,PIPESTATUS,set -xwithPS4, and
traps for signals,EXIT,ERR,DEBUGandRETURN. - Builtins: Bash
read,mapfile,getopts,printf(with%(fmt)T),
type,command -v,hash,help,ulimit,pushd/popd/dirs, and
more. - Interactive shell: UTF-8 editing with a kill ring, undo, bracketed paste
and vi mode; history expansion; programmable completion; keyword
highlighting;PS1escapes andPROMPT_COMMAND.
Upgrading from 0.4
These changes can alter what existing wsh scripts do:
- A bare word in a command argument stays literal:
status=x; git status
runsgit status. Inside language expressions (if count > 10 {,
print name) bare names still refer to variables. name=valueno longer exports the variable to child processes; use
exportorenv NAME = value.wsh -c 'cmd' a bsets$0toaand$1tob, asbash -cdoes.readreturns 1 at end of input.- An expansion error such as
${x:?message}stops a non-interactive shell with
status 1. - Functions take precedence over builtins of the same name.
- Native expression arithmetic rejects non-numeric operands instead of treating
them as 0. - Scripts no longer print
[1] pidfor background jobs; interactive shells
still do.
Known differences from Bash
$nameon an indexed array expands to every element, as it does for wsh
lists; Bash gives element 0. Use${name[0]}in scripts meant for both
shells, including for$BASH_REMATCH.BASH_COMMANDis not set.<and>in[[ ]]compare bytes rather than the locale's collation
order.
Install or upgrade
Download wolysh-v0.5.0-linux-x86_64.tar.gz and its .sha256 file:
sha256sum -c wolysh-v0.5.0-linux-x86_64.tar.gz.sha256
tar -xzf wolysh-v0.5.0-linux-x86_64.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 0755 wolysh-v0.5.0-linux-x86_64/wsh "$HOME/.local/bin/wsh"
"$HOME/.local/bin/wsh" --versionEnsure $HOME/.local/bin is on PATH. Source builds require Zig 0.16.0:
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux -Dcpu=baselineVerification
CI and the release workflow build for baseline x86_64, check that the tag
matches wsh --version, and run the unit, interactive and compatibility suites
before packaging. Most compatibility suites run each case in wsh and in Bash and
require the same output and exit status.
- 337 unit tests
- 37 interactive checks
- 319 compatibility tests
Benchmarks were not re-measured for this release; the packaged results
describe v0.4.0.
wolysh v0.4.1
wolysh v0.4.1: portable Linux x86_64 release
This patch release fixes the distributed binary's CPU target. The v0.4.0
archive was built for the GitHub runner's native CPU and can terminate with
SIGILL on other x86_64 machines. v0.4.1 builds and tests the archive for
baseline x86_64, without requiring the runner's optional instruction extensions.
Upgrade to v0.4.1 if you downloaded v0.4.0. The v0.4.0 tag remains unchanged.
Native parallel, fail-fast queueing, JSONL reports, syntax checks, and all
other 0.4.0 features are included.
Install or upgrade
Download wolysh-v0.4.1-linux-x86_64.tar.gz and its .sha256 file:
sha256sum -c wolysh-v0.4.1-linux-x86_64.tar.gz.sha256
tar -xzf wolysh-v0.4.1-linux-x86_64.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 0755 wolysh-v0.4.1-linux-x86_64/wsh "$HOME/.local/bin/wsh"
"$HOME/.local/bin/wsh" --versionEnsure $HOME/.local/bin is on PATH. Source builds still require Zig 0.16.0.
To build a portable binary from source:
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux -Dcpu=baselineVerification
CI and the release workflow use the same baseline x86_64 target for unit tests
and the ReleaseFast binary, followed by the interactive and compatibility suites.
The release workflow verifies the tag against the binary version before packaging.
The published archive is downloaded and checked against its SHA-256 file, then
tested on a separate x86_64 machine with syntax-check and parallel/report smoke
tests. Benchmark samples packaged with this patch describe the v0.4.0 native
development build, not the baseline archive; see their recorded versions,
checksums, and methodology before applying the ratios to another build.
- 148 unit tests
- 37 interactive checks
- 40 compatibility tests
wolysh v0.4.0
Superseded by v0.4.1: The v0.4.0 Linux binary can fail with
SIGILLon 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 Nruns 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-faststops 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 pathwrites 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/--checkvalidates 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 -nblocks 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, andwait $!can consume an already-reaped background job. - A stopped job remains available for resumption after
waitreturns. - 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" --versionEnsure $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 fmtzig build test: 148 unit testszig build -Doptimize=ReleaseFastpython3 tests/pty_test.py: 37 interactive checkspython3 tests/shell_compat_test.py: 40 compatibility tests- Temporary-prefix installation, release packaging, archive checksums, and
syntax-check smoke tests
v0.3.5
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Full Changelog: https://github.com/dev-dami/wolysh/commits/v0.1.0