diff options
Diffstat (limited to 'web/content/_index.md')
| -rw-r--r-- | web/content/_index.md | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/web/content/_index.md b/web/content/_index.md new file mode 100644 index 0000000..341db58 --- /dev/null +++ b/web/content/_index.md @@ -0,0 +1,74 @@ +--- +title: zash +description: A small, fast POSIX shell for z/OS UNIX System Services, in the Almquist (ash) tradition. +--- + +## Why another shell + +The z/OS `/bin/sh` is dated, and the usual alternatives are bash and zsh. +Those are comfortable interactively but slow as scripting shells, large, and +encourage scripts that run nowhere else. On z/OS that cost is real: CPU time is +billed, and every `fork()` copies an address space. + +<div class="feature-grid"> + <div class="card"> + <span class="tag">cheap processes</span> + <h3>spawn(), not fork()</h3> + <p>Children come from <code>spawn()</code>, so <code>_BPX_SHAREAS</code> + can keep them in the same address space. Builtins cost no process at all, + even in a pipeline or a command substitution.</p> + </div> + <div class="card"> + <span class="tag">plain POSIX</span> + <h3>sh scripts, not a dialect</h3> + <p>Scripts written for zash run under the existing <code>/bin/sh</code>, + dash, FreeBSD sh and bash. The Korn features z/OS scripts use are there + where they cost other scripts nothing.</p> + </div> + <div class="card"> + <span class="tag">built for z/OS</span> + <h3>ASCII or EBCDIC</h3> + <p>The character set is a compile-time choice and the source assumes + neither. File tagging, <code>STEPLIB</code> and the z/OS shell behaviours + scripts rely on are in scope.</p> + </div> + <div class="card"> + <span class="tag">pleasant</span> + <h3>An interactive shell too</h3> + <p>Job control, tab completion, history, emacs and vi editing, with + bash's key bindings. None of it is initialised by a non-interactive + shell.</p> + </div> +</div> + +## How it compares + +CPU-seconds on Linux x86-64 from `make bench`, user+sys with children +included. The benchmark scripts check each shell's answers as well as timing +it. + +| benchmark | zash | dash | bash | ksh93 | oksh | +| --- | --- | --- | --- | --- | --- | +| `$(builtin)` x 40000 | 0.01 | 8.20 | 17.99 | 0.11 | 25.24 | +| small pipelines and `$(a \| b)` | 1.10 | 2.35 | 3.16 | 1.33 | 2.32 | +| render and check 100 configs | 0.38 | 0.46 | 0.53 | 0.26 | 0.52 | +| 2000 external commands | 0.55 | 0.53 | 0.81 | 0.56 | 0.84 | + +On z/OS the gap against IBM's `/bin/sh` is far wider, because a `fork()` there +copies an address space. The full tables for both platforms are in the +[project README](https://github.com/skurtz97/zash#status). + +## Get started + +```sh +git clone https://github.com/skurtz97/zash +cd zash +make # Linux: ./zash +make check # run the suite +``` + +On z/OS, `make` builds the ASCII `./zash` with IBM Open XL C/C++ and +`make zos-ebcdic` builds the EBCDIC variant. See +[Building zash]({{< relref "docs/install" >}}) for the z/OS targets and the +address-mode notes, and [Development]({{< relref "docs/develop" >}}) for what +the test suite covers. |
