summaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #42 from skurtz97/docs/charset-819Sean Kurtz3 days1-8/+10
|\ \ | | | | | | design: state the zopen 819 rule, not a retagging recipe
| * | design: state the zopen 819 rule, not a retagging recipeSean Kurtz3 days1-8/+10
|/ / | | | | | | | | | | | | | | The paragraph said to tag UTF-8 files ISO8859-1 and advised chtag -tc UTF-8, which is neither what the repository does nor what zopen wants: it codes to CCSID 819, has git check text out tagged ISO8859-1, and lists the files whose text Latin-1 cannot hold as UTF-8 exceptions in .gitattributes. It also put a euro sign in a file declared ISO8859-1.
* | Merge pull request #41 from skurtz97/docs/charsetSean Kurtz3 days1-0/+17
|\ \ | | | | | | design: say who converts character sets, and who does not
| * | design: say who converts character sets, and who does notSean Kurtz3 days1-0/+17
|/ / | | | | | | | | | | | | | | | | | | | | zash copies bytes; on z/OS the runtime converts between a tagged file and the program, and the ASCII build turns that on for itself. The line editor is the one place that looks at encoding: it keeps UTF-8 continuation bytes with their character, and does not measure double-width text. This is the paragraph missing from the questions about `cat` printing mojibake from a checkout whose files are tagged ISO8859-1.
* | Merge pull request #40 from skurtz97/web/redesignSean Kurtz3 days16-277/+585
|\ \ | | | | | | web: a design pass, and documents that stand on their own
| * | web: a design pass, and documents that stand on their ownSean Kurtz3 days16-277/+585
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The home page drops the feature-card grid for a numbered spec sheet and a full-width measured transcript. The docs pages get three columns on a wide screen - sections, text, and the page's own headings - with a rule that runs the height of the text, and a row of section chips on a phone. The hero carries the logo's periwinkle as a gradient and the grid of a terminal screen, and the header a single lit hairline. The generated README, Design and Specification pages no longer carry the logo block, the byline, their own contents list or a second title: the site header, the sidebar and the front matter do that. Links between the documents are page links, and the GitHub-only affordances (sidebar blob links, "Edit this page") are gone. The xlc compiler is no longer called legacy in README, DESIGN or status.
* | Merge pull request #39 from skurtz97/editor/one-editoreditor/vi-v-dotSean Kurtz4 days20-418/+51
|\ \ | | | | | | interactive: one editor, no library
| * | interactive: one editor, no libraryeditor/one-editorSean Kurtz4 days20-418/+51
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libedit was a compile-time alternative (`make EDIT=libedit`). It goes: FreeBSD and NetBSD `sh` use it because it is in their base system, which is not the case on z/OS, and it cost about a third of a millisecond to reach the prompt -- three more shared libraries, `el_init()`, an `~/.editrc` read and a copy of the history -- for the same cost per key. What it bought was `~/.editrc` bindings and a kill ring; `bind` and the built-in editor's own bindings cover the keys, and a second editor meant a second build mode and a second set of interactive expectations, with seven tests skipping under it. Everything that existed only to serve two editors goes with it: the `EDIT` switch and the two `edit_$(EDIT)` paths in the makefile, the `$ZASH_EDITOR` variable the tests used to skip, the skip guards in `tests/linux/`, the NUL stripping in `ptydrive.py` that libedit's redraw needed, and the parallel paragraphs in README.md, DESIGN.md, bench/README.md and the two website pages. `bench/README.md` keeps the measurement, since that is why the decision is written in DESIGN.md. Checked on Linux (97 passed, 1 skipped, the one known local failure in linux/i-dscomplete) and on z/OS (64 passed, 3 skipped, 0 failed, plus the EBCDIC build).
* | Merge pull request #38 from skurtz97/edit/libedit-completionSean Kurtz4 days15-96/+315
|\ \ | | | | | | interactive: completion works in the libedit build too
| * | interactive: completion works in the libedit build tooSean Kurtz4 days15-96/+315
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libedit editor had no Tab binding at all, so the same line typed in the two builds behaved differently: `myalias<Tab>` completed under the built-in editor and ran the name as written under libedit. Completion is not an editor feature here — it is the shell's, from complete.c — so the boundary moves: complete.c now owns the escaping (`complete_escaped()`) and the candidate listing (`complete_listing()`), and each editor only inserts the result into its line. For libedit that means a function bound to ^I: it deletes the word, inserts the escaped candidate, finishes a unique one with a space and asks for a full redraw (a tail-only refresh left the terminal showing a line the shell did not have). Two things cost time to find: the binding name is the editrc spelling `^I`, not a literal Tab, and EL_EDITOR has to be set before EL_ADDFN/EL_BIND, because selecting an editor replaces the key map and drops what was bound before. $ZASH_EDITOR says which editor is compiled in. Keys, redraw and listings are the editor's own — libedit reads ~/.editrc, and its redraw of a prompt that starts with an OSC title leaves one space too many on the screen — so the interactive tests that encode the built-in editor's bindings and drawing skip under libedit, with a reason. i-complete, which covers the completion both now share, passes under both. tests/tools/ptydrive.py drops NUL bytes from what it compares: libedit writes a run of them after "erase to end of line" when it redraws, and a NUL puts nothing on a screen. Built-in build: 97 passed, 1 skipped, 1 failed (linux/i-dscomplete, the known local failure). libedit build: 6 passed, 7 skipped, 0 failed.
* | Merge pull request #37 from skurtz97/bench/startup-roundsSean Kurtz4 days3-9/+46
|\ \ | | | | | | bench: make the start-up number a minimum of interleaved rounds
| * | bench: make the start-up number a minimum of interleaved roundsbench/startup-roundsSean Kurtz4 days3-9/+46
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | startup.sh ran BENCH_N starts once, and on the shared z/OS machine the same binary measured anywhere between 5 and 14 ms depending on the hour. Now each cell is the fastest of BENCH_R rounds (default 5) of BENCH_N starts, and a row's two columns are measured one after the other inside each round, so `-c :` and `script` see the same load instead of one following five rounds of the other. A minimum is the right summary because contention only adds time. Measured that way on cbt today, zash is 1.34 ms for `-c :` and 1.36 ms for a script, and the z/OS sh 2.16 and 2.18 — the same two numbers bench/README.md already claimed from a quieter machine, which is the point: the method now reproduces them. Also records the rule the ksh88 constraint implies: where zash and the z/OS sh disagree, zash keeps the better behaviour unless a ksh88 script could observe it, and the one such case — a failed redirection, assignment or read being 2 rather than 1 — is accepted because POSIX does not pin it and the shells disagree among themselves.
* | Merge pull request #36 from skurtz97/bench/compat-triageSean Kurtz4 days2-3/+37
|\ \ | | | | | | bench: read the 28 differences from the host's sh
| * | bench: read the 28 differences from the host's shbench/compat-triageSean Kurtz4 days2-3/+37
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Every script that zash and the IBM sh disagree on has now been read. None is a zash bug: zash matches dash on all 38 (that is what the suite says), and the differences are the IBM shell's — it cannot do `[ a \< b ]`, `fc`, or arithmetic across a newline; it exits where `command eval` should only set a status; it keeps literal quotes inside `${y:-"q r"}` and empty fields from unquoted `$@`; its exit status is 1 for every failure. The one row that is our choice is the status one: the ash family's 2 for a failed redirection, which DESIGN.md already lists and this now records in the table, so that a ksh script on z/OS testing `$?` against 1 is not a surprise.
* | Merge pull request #35 from skurtz97/bench/host-sh-compatSean Kurtz4 days2-0/+73
|\ \ | | | | | | bench: measure zash against the sh this host has
| * | bench: measure zash against the sh this host hasbench/host-sh-compatSean Kurtz4 days2-0/+73
|/ / | | | | | | | | | | | | | | | | | | | | | | `compat.sh` runs every tests/posix script under zash and under another shell, each in an empty directory, and prints the ones whose output or status differ. It is not a test: the .exp files are a reference shell's output, and on z/OS /bin/sh is IBM's ksh-lineage shell with wording and statuses of its own. The count is how close a script naming #!/bin/sh gets to its meaning here; the diffs say which differences to read. On cbt, 10 of the 38 scripts agree and 28 differ, most of them on diagnostics.
* | Merge pull request #34 from skurtz97/web/spec-mdSean Kurtz4 days8-7/+197
|\ \ | | | | | | web: the specification as a page, converted from typst's HTML
| * | web: the specification as a page, converted from typst's HTMLchore/c23-idiomsSean Kurtz4 days8-7/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typst writes no markdown, so the site had the typeset HTML export and no page that a reader could search or link into. web/spec-md.py reduces the export to what goldmark reads and hands it to pandoc, then puts back the heading ids the spec cross-references itself by and carries the MathML over untouched: browsers render it, so the page ships no TeX script. `make docs` writes it with the other document pages, and the site stays hand-written pages until someone runs that.
* | | Merge pull request #33 from skurtz97/feat/prompt-widthSean Kurtz4 days11-19/+338
|\| | | | | | | | interactive: a prompt's width counts columns, not bytes
| * | interactive: a prompt's width counts columns, not bytesSean Kurtz4 days11-19/+338
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The built-in editor skipped `ESC [ ...` sequences when working out where the prompt ends. Colour and titles are not all CSI: an OSC title or hyperlink runs to BEL or `ESC \`, DCS runs the same way, and `tput sgr0` is the three-byte `ESC ( B` before `ESC [ m`. A prompt built with `$(tput ...)` was measured wrong, which costs the cursor position and with it the wrapped-line arithmetic. `esc_seq_len()` in interact.c now walks what a terminal understands, and edit_builtin.c uses it. The libedit build shares the walk: it brackets control runs for `EL_PROMPT_ESC`, and adds the space libedit needs when a prompt ends in one, since libedit attaches a literal run to the character after it. bench/editor.py measures the two costs run.sh cannot see, start to first prompt and per-key echo, on a pty; bench/README.md has the table. The release, z/OS and fuzz builds move to -O3 while the sanitizer and coverage builds stay low: inlined frames make their reports harder to read than the few percent they would gain.
* | Merge pull request #32 from skurtz97/fix/zos-posix-makeSean Kurtz4 days3-7/+66
|\ \ | | | | | | z/OS: make zash and make parse under POSIX make again
| * | z/OS: make zash and make parse under POSIX make againSean Kurtz4 days3-7/+66
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b786aac put a GNU conditional inside the zash rule. z/OS /bin/make is IBM POSIX make: it has no ifeq and no $(shell), so plain make and make zash both stopped at line 124 with FSUM8232 before any target ran. The rule also required $(OBJS), and that names src/sys_posix.o, which uses posix_spawn and does not compile on z/OS. The prerequisites are now the sources; on Linux they are newer than the objects exactly when zash-posix has work, so the delegation is a no-op once built. The new test pins ZOS_SYSNAME and ZOS_SYSPLEX against sysvar(1), and the shape of ZOS_RELEASE, ZOS_ASID and ZOS_JOBNAME, whose values belong to the one process. zos-lint now rejects GNU-only make syntax, so a conditional cannot come back unnoticed.
| * perf: restore cwd after a lone ( cd dir ) in-processperf/cd-inprocSean Kurtz5 days7-16/+72
| | | | | | | | | | | | | | A subshell whose body is a single cd now runs in the parent shell with the directory, PWD, OLDPWD and curdir saved and restored, instead of forking. On z/OS a fork costs ~0.4 ms there; the cd itself costs ~5 us. A readonly, integer or dynamic PWD/OLDPWD keeps the forked path.
| * perf: run a lone ( cd dir ) without forkingSean Kurtz5 days3-8/+58
|/
* Merge pull request #29 from skurtz97/chore/c23-idiomsSean Kurtz5 days20-175/+287
|\ | | | | C23 idioms, 64-bit default link, script charset; docs at the new numbers
| * docs: the z/OS tables and prose at 64-bit, C23 and the LPASean Kurtz5 days4-105/+137
| | | | | | | | | | | | | | | | | | README's benchmark table is the 64-bit run with the run-time in the LPA and zsh installed (it was the 2.1-era table, and its zsh column was the 31 ms start-up, not zsh). bench/README.md keeps the 2.1 numbers as the history of what the LPA fixed, and gains the start-up table it now has a measurement for. investigation.md's §2 recommendation was still "build 31-bit"; it now says what happened instead.
| * Makefile: make zash on z/OS links the 64-bit build itselfSean Kurtz5 days1-2/+12
| | | | | | | | | | exec-ing into make zos-ascii hung here with no child processes, and the shell target is the same command line anyway.
| * C23: constexpr internal linkage, naming and trailing commas; clangd at C23Sean Kurtz5 days15-69/+134
| | | | | | | | | | | | | | | | A constexpr at file scope has external linkage, so the CSI offsets and CSI_MAX_CALLS now say static. The naming check gets the C23 spellings wrap the check itself: typed constants keep the macro case, and a local static constexpr table keeps the variable case. .clangd says -std=c23, which it still did not, so the editor could not read constexpr at all.
| * z/OS: convert a script's character set only in an ASCII buildfix/zos-script-charsetSean Kurtz5 days1-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input_push_fd() called sys_input_cvt() for every script on z/OS, and that routine converts to the program's own CCSID. In an ASCII build reading an IBM-1047 system it therefore either asked for EBCDIC-to-EBCDIC conversion, which is a no-op that returns 0, or read the bytes unconverted; SETCVTON on a descriptor that sys_dupfd() has renumbered returns 0 and converts nothing on this system either. The parser then saw EBCDIC and dropped the script. An EBCDIC build reads IBM-1047 natively and never wanted the call. With the conversion left to ASCII builds, posix/traps and scripts/signals pass on z/OS: 93 passed, 4 skipped, 0 failed. The untagged-file case still depends on SETCVTON with an explicit fccsid, which is unverified, so the VERIFY note stays.
* | Merge pull request #30 from skurtz97/fix/zos-gitattributesSean Kurtz5 days1-0/+12
|\ \ | |/ |/| z/OS: keep ISO8859-1 checkout working for every file
| * z/OS: keep ISO8859-1 checkout working for every fileSKURTZ5 days1-0/+12
|/ | | | A blanket zos-working-tree-encoding=ISO8859-1 makes a fresh checkout fail on three binaries and seven files with characters outside Latin-1. Mark those UTF-8 or binary after the blanket rules, matching zopen per-file exceptions, so git worktree add and clone succeed while all other text is tagged ISO8859-1.
* Merge pull request #27 from skurtz97/feat/web-siteSean Kurtz5 days19-1/+1312
|\ | | | | web: a Hugo site for zash
| * web: a Hugo site for zashfeat/web-siteSean Kurtz5 days19-1/+1312
|/ | | | | | | | | | | | | | | | | | | | | | | | | | A site in web/, built with Hugo and no theme module, so it builds offline from one Go binary: hugo server --source web preview on localhost:1313 hugo --source web --minify -> web/public, which is ignored Pages: a home page with the shell's pitch, a terminal card, the four properties that define it and a short benchmark table, plus three docs pages (building, development, status) in a section with a sidebar. The palette comes from packaging/zash-logo.svg: mainframe navy, periwinkle, a signal blue. Dark only, monospace where a shell would be monospaced. Highlighting uses classes (`markup.highlight.noClasses = false`) against assets/css/chroma.css generated with `hugo gen chromastyles --style= tokyonight-night`, so code sits in the page instead of a monokai box. site.css and copy.js go through Hugo's minify+fingerprint pipeline. Two .gitignore fixes this needed: `docs/` matched web/content/docs/ (the generated Doxygen output is at the root, so it is `/docs/` now), and Hugo's .hugo_build.lock is ignored. Not published yet: zash is private and Pages is not available for a private repository on a free plan, so web/README.md records the options.
* C23: nullptr for null pointers, constexpr for typed constantsSean Kurtz5 days34-244/+251
| | | | | | | | | | | | | | nullptr in every place a null pointer constant was meant; NULL is gone from src/. constexpr where it improves on #define without costing anything: the IGGCSI00 work-area offsets and sizes, and the scalar sizes MVS_DSN_MAX, CSI_FIELD_LEN, CSI_WORK_MIN, PDS_DIRBLK, CSI_WORK, CSI_MAX_CALLS. A constexpr in C is a constant expression, so it still bounds the arrays that use it, and it now carries a type and can be checked with static_assert. Feature switches (#if), the CSIETYPE/EBCDIC byte constants read as octets, and the related-constant enum sets stay as they were.
* repo: drop patches/, move spec-pdf.sh out of scripts/Sean Kurtz5 days3-125/+1
| | | | | | | patches/ held one file, a byte-identical copy of LICENSE; no port patches anything (ZOPEN_TYPE=LOCAL builds the checkout). The single script was the typst spec builder, which is a build step, so it lives beside the other build machinery.
* Merge pull request #26 from skurtz97/chore/c23Sean Kurtz5 days12-44/+44
|\ | | | | C23: compile as C23 and use its spelling
| * C23: compile as C23 and use its spellingSean Kurtz5 days12-44/+44
|/ | | | | | | | | | | | | | | | | | | | | | | The z/OS toolchain would not take C23 when this was first written; IBM Open XL C/C++ 2.2 does (clang 21.1, __STDC_VERSION__ 202311), and so does the clang on Linux. -std=c23 in the Makefile, and the standard attributes in place of the ones that were macros: _Noreturn -> [[noreturn]] (on declarations and definitions) _Static_assert -> static_assert _Alignas -> alignas NODISCARD -> [[nodiscard]] FALLTHROUGH -> [[fallthrough]] PRINTFLIKE and UNREACHABLE() stay macros: [[gnu::format]] and [[gnu::unreachable]] are vendor attributes, and the standard has no [[format]] or [[unreachable]] for a header-only project yet. Standard-library additions newer than the libc of either system (<stdbit.h>, <stdckdint.h>) are not used, so gcc -std=c2x still builds the tree warning-free. The suite, ASan/UBSan and the z/OS lint pass as before; linux/i-dscomplete remains the one local failure it was on main.
* Merge pull request #25 from skurtz97/build/zos-64bitSean Kurtz5 days6-96/+185
|\ | | | | build/zos 64bit
| * build: make the 64-bit z/OS build the defaultSean Kurtz5 days5-72/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zash is built 64-bit on z/OS now: -m64 for the ASCII and the EBCDIC build and for the debug build, and `make` as well as `make zash` land on zos-ascii there. The 31-bit build existed for the 64-bit start and fork costs, which were the C run-time being loaded out of the linklist; with CELQ* in the LPA the widths measure the same and the shell is built at the width IBM builds for. The catalog and dynamic-allocation modules are AMODE 31 and OS_UPSTACK does not exist at -m64, so both are declared with plain OS linkage, which is the 64-bit glue for an AMODE 31 callee. Neither module is installed on the test system, so that path is unverified there; csi_call() still catches a program check and retires the catalog. IGGCSI00's VL bit comes from the width of a pointer, not 0x80000000. Documentation follows: README gains a Recommendations section for the LPA change and loses the 31-bit rationale; DESIGN.md's cost model, catalog linkage and open questions match the measurements; bench/README states the current width and the rerun numbers; investigation.md records the decision.
| * build: 64-bit on z/OSSean Kurtz5 days2-24/+26
|/ | | | | | | | | | | | | | | | | | The 31-bit choice existed for one reason: a 64-bit start cost 29 ms against 1 ms and a 64-bit fork() 4.2 ms against 0.10. That was the 64-bit C run-time being loaded out of CEE.SCEERUN2 on the linklist on every start; with CELQ* in the dynamic LPA both widths cost 1.5 ms and fork() 0.10 ms (notes/investigation.md has the before and after). So build the shell at the width IBM builds for: -m64 for both the ASCII and the EBCDIC build, and for the debug build. OS_UPSTACK does not exist at -m64, so the two AMODE 31 services (IGGCSI00, BPXWDY2) are declared with plain OS linkage, which is what the 64-bit glue implements. IGGCSI00's VL bit is set from the width of a pointer now, not with 0x80000000. Neither module loads on this system, so the linkage itself stays unverified; csi_call() still traps a program check and retires the catalog if it abends.
* Merge pull request #24 from skurtz97/docs/no-hostnameSean Kurtz5 days3-10/+10
|\ | | | | docs: name the system by release, not by its hostname
| * docs: name the system by release, not by its hostnameSean Kurtz5 days3-10/+10
|/
* Merge pull request #23 from skurtz97/notes/rebench-before-afterSean Kurtz5 days1-6/+35
|\ | | | | notes: 64-bit before and after the LPA change, side by side with 31-bit
| * notes: 64-bit before and after the LPA change, side by side with 31-bitSean Kurtz5 days1-6/+35
|/
* notes: rebench 64-bit against 31-bit after the LPA change (#22)Sean Kurtz5 days1-0/+7
|
* Merge pull request #21 from skurtz97/notes/celq-lpa-permanentSean Kurtz5 days3-5/+83
|\ | | | | notes: make the 64-bit runtime LPA residency permanent
| * notes: make the 64-bit runtime LPA residency permanentSean Kurtz5 days3-5/+83
|/ | | | | | | | PROGLE already puts the 31-bit runtime in the dynamic LPA with three LPA ADD statements, so the 64-bit one is a fourth statement there, activated with SET PROG=LE and no IPL. Say where this LPAR keeps the statements (LOADC3 -> SYS3.CBT.PARMLIB.V3R1, IEASYS01, PROGLE) and add the SDSF exec and its batch JCL for re-applying them after an IPL.
* bench: the 64-bit start-up cost was the runtime not being in the LPA (#20)Sean Kurtz5 days2-28/+103
| | | | | | | Adding the CELQ members of CEE.SCEERUN2 to the dynamic LPA takes a trivial 64-bit start from 5.83 ms to 1.63 ms, the fork() cost from 4.20 ms to 0.10 ms, and /bin/zsh from 31.4 ms to 3.6 ms. The 27x ratio this repo has been explaining since PR #15 was a system not following IBM's own advice for the 64-bit runtime.
* notes: the 64-bit runtime is loaded from the linklist, not the LPA (#19)Sean Kurtz5 days3-8/+55
| | | | | | | * bench: keep the HLASM probe comments out of the continue column Also fixes the tiny64.s header, which named tiny31.s. * notes: the 64-bit runtime is loaded from the linklist, not the LPA
* Merge pull request #18 from skurtz97/bench/probes-in-repoSean Kurtz5 days7-73/+129
|\ | | | | bench: keep the start-up and fork probes in bench/probes