lib: retire os.assert/abort shims — assert/abort are builtins (#58 respell)

The flat checker scope makes ANY decl named assert/abort anywhere in
the combined unit disable the builtin unit-wide (the #45 shadow shape:
scope_lookup_prefer's cross-module fallback finds it). lib carried
three colliding @symbol("rt_abort") shims (os, time, strconv/stof)
plus the os.assert wrapper, so a bare assert(cond) in ANY program
importing os mis-bound os.assert and failed arity — a hard blocker for
regex fold-5 (regex.ha:660/670 bring builtin-assert mass). Ruled
respell-now per the recurrence test (#45 -> #58).

Delete the shims and the os.assert wrapper; every bare abort(msg)
caller (regex, strings, utf8, hash, getopt, encoding/*, time, stof)
now lands on the builtin, and the ~40 os.assert(c, m) sites respell to
the builtin assert(c, m) — restoring the exact Hare spelling the lib
ports diverged from (e.g. ref/hare/bytes/tokenize.ha:23). os.assert
had no Hare counterpart (Hare's assert is a language builtin); rule-9
wrapper removed. temp/dirs/bufio already use the non-colliding rtabort
spelling and keep it.

Now-dead 'import os;' lines kept (pre-existing precedent:
lib/strconv/strconv.ww carries one); a tree-wide dead-import sweep is
a separate concern. regex.ww's if+abort workarounds citing #58 stay
for the fold-5 owner to fold back into assert.

combined.ww regenerated for all five selfhost tools + the smoke
fixture via make.
This commit is contained in:
2026-06-04 22:08:07 +09:00
parent e091dfbdbe
commit 3daf134395
18 changed files with 199 additions and 263 deletions

View File

@@ -36,7 +36,7 @@ static const char *modules[] = {
* post-Commit B; lib/errors.errno references os.errno / os.E* /
* os.strerror (ww folds Hare's sys role into os); lib/strings.iterator
* + lib/strings.next reference utf8.decoder / utf8.done;
* lib/bytes.tokenize references os.assert + types.I64_MAX/MIN per
* lib/bytes.tokenize references the assert builtin + types.I64_MAX/MIN per
* ref/hare/bytes/tokenize.ha:23-24,42-43; lib/encoding/hex and
* lib/encoding/base64 graduated to Hare's io-streaming surface
* (hex references io.handle / fmt.fprint / memio.dynamic / strconv /