A slice is the ABC way to pass a span of memory: a pair of pointers [head, term), consumed by moving head toward term. It replaces the pointer-plus-length pair, so a function that reads or writes part of a span advances the head and the remaining work is simply the rest of the slice — there is no separate count to keep in sync. Four const shades encode intent, typed helpers move the borders, and a_-macros carve slices over arrays, literals, and buffers without any pointer arithmetic.
A slice's type says what you may do to it: change the bytes, or move the pointers. Picking the right shade documents whether a function consumes its input or only reads it.
u8s is writable (output / idle space); u8cs is const-value, the usual input you consume.u8sc has fixed pointers but editable bytes; u8csc is fully immutable.u8s as a parameter means consumed (head advances); u8sp means assigned (the function writes the head/term cells).Prefer the typed function over the generic macro: the typed names move borders explicitly and read clearly. Reach for a generic only when no typed form exists.
u8csLen, u8csEmpty, u8csOK over $len / $empty / $ok.u8csAt(s, i) returns the byte value; u8csHead(s) returns the head pointer — they are not the same.u8csUsed / u8csUsed1 (head) and u8sShed1 (term); never write s[0] += n by hand.u8csFind (one byte) or u8csFindS (a sub-slice); copy pointers with u8sMv, bytes with u8sFeed.
Slices are carved over existing memory with a_-macros, never by computing pointers. Walk them with the $for family, which iterates without exposing raw pointer math.
a_dup (a consumable copy), a_head / a_tail / a_rest (sub-slices), a_cstr (a literal), a_pad (a stack span).$for / $rof walk forward / back; $eat consumes while iterating.A gauge is two adjacent slices sharing a boundary — a left part and a rest — used to build a span up in place. Unlike a buffer it owns no memory.
u8gOf(g, slice) starts with an empty left and the full rest; u8gFeed1 moves one element into the left.a_lign with a_cquire (see BASS) to grow a slice of unknown length in arena scratch.