lib: rename stdlib surface to Hare names; add endian/math

Sweeping rename so the lib/ surface mirrors Hare's stdlib spellings.
- ascii: rune-taking predicates; ishex -> isxdigit
- bufio: rinit -> init; take1/takeline -> readbyte/readline
- bytes: indexsub -> index
- encoding/utf8: runelen -> runesz
- errors: eEOF/eShortRead/... -> eof/underread/...
- fmt: errln -> errorln; println/fprintln return i64
- os: readfull/writefull -> readall/writeall; unlink -> remove
- path: isabs -> abs; drop lastindex (now strings.rbyteindex)
- strconv: u64toa/i64toa -> u64tos/i64tos; parse64/parseu64 -> stoi64/stou64
- strings: drop len/isempty; equal -> compare; indexbyte -> byteindex; +rbyteindex
- types: drop numeric helpers (moved to math)
- new lib/endian (htonu16/ntohu16), lib/math (absi32/absi64)
- net: drop htons (use endian.htonu16)

Callers in selfhost/, lib/ww/, cmd/w6c/cgen.c, and test/wcc/700_e2e.c
updated to match.
This commit is contained in:
2026-05-12 00:45:18 +09:00
parent 35421f2561
commit 1ac1d985f6
37 changed files with 597 additions and 568 deletions

View File

@@ -95,7 +95,7 @@ export fn main(argc: i32, argv: **u8) i32 = {
let a: *arena = newarena();
let buf: *u8 = amalloc(a, sz: u64): *u8;
let r: i64 = os.readfull(fd, buf, sz: u64);
let r: i64 = os.readall(fd, buf, sz: u64);
os.close(fd);
if (r != sz) {
os.write(2, "wwdump: short read\n".ptr, 19u64);
@@ -134,11 +134,11 @@ export fn main(argc: i32, argv: **u8) i32 = {
os.write(1, argstr(path).ptr, argstrlen(path): u64);
os.write(1, ": ".ptr, 2u64);
let buf: [32]u8;
let n: i32 = strconv.i64toa(buf[0:32], ck.nresolved: i64);
let n: i32 = strconv.i64tos(buf[0:32], ck.nresolved: i64);
os.write(1, buf.ptr, n: u64);
os.write(1, "/".ptr, 1u64);
let total: i32 = ck.nresolved + ck.nunresolved;
n = strconv.i64toa(buf[0:32], total: i64);
n = strconv.i64tos(buf[0:32], total: i64);
os.write(1, buf.ptr, n: u64);
os.write(1, " resolved\n".ptr, 10u64);
if (ck.nunresolved > 0) { return 1; };