kimapr (kimapr@ublog.kimapr.net)'s status on Sunday, 26-Jan-2025 20:15:17 JST
-
Embed this notice
@navi @domi @ar @multisn8 @lanodan and this array sucks also, can't even do indirect indexing and passing it around is very expensive.
when i was making one weird shell script and did it in posix sh (for religious and torture reasons) i eventually settled on implementing my own arrays with eval hacks (each element of an array is stored in its own variable and the "array variable" stores a prefix used to find them - eval is needed to reference the variables dynamically) - it was much better (both faster and pleasanter) than the previous $@-based approach and astronomically better than the "store an array as a newline-delimited list of encoded strings in a variable and pipe it into filters and store back the output to the variable" approach which is then astronomically better than the same thing but with NULs and no encoding - that one is unusably slow because POSIX sh doesn't even have a way to read a NUL-terminated string from a stream without invoking fucking dd for each fucking byte