2024-04-04 04:04:20 bah. i need to create several arrays of numbers that at most only need 10 bits. do i just make them 4 byte cells or go through the trouble of packing? 2024-04-04 04:06:09 i guess the conventional wisdom would be to KISS and optimize it only if it's a problem 2024-04-04 15:12:24 Given that Forth offers c@, w@, and @, I'd probably just use w@ and run with that. Then you've gained most of the optimization with no loss of simplicity. 2024-04-04 15:12:55 I agree re: not trying to pack all the way to 10 bits unless it became necessary. 2024-04-04 15:16:08 what forth has w@? i've gone crazy with the size prefixes in the past but ultimately settled on limiting it only to c@ and @ to keep things simple for this application 2024-04-04 15:16:22 i've never seen w@ in traditional forths 2024-04-04 15:23:53 anyway, it's not that hard to write it i guess 2024-04-04 16:37:20 is there any greater joy in life than making a chance that reduces your code by 10%? 2024-04-04 16:37:49 the answer is yes. making a chance that reduces your code by 11%. 2024-04-04 17:57:57 implementing w@ w! w, and w+! and using those versus using cells saves 126 bytes right now. definitely not worth it. 2024-04-04 21:15:43 Well, mine does, but I saw it somewhere. I couldn't tell you where, though. 2024-04-04 21:16:01 On a 32-bit system it might be called h@? 2024-04-04 21:16:07 "half fetch" 2024-04-04 21:16:28 I call it w@ on my 64-bit system, so maybe I only saw h@ on a 32-bit system at some point in time. 2024-04-04 21:17:58 If I were on a 64-bit system that only offered 32 and 64 bit access, I'd probably define w@ and then the thing I'd keep in my hip pocket would be the knowledge that I could implement it as a primitive later if I wanted to. 2024-04-04 21:18:56 But I'm sure there's probab like a hundred ways you could arrange things to make it easy to either time or space optimize later. 2024-04-04 23:55:06 x86 has a "nop" instruction that takes a register or memory argument. when you disassemble it, objdump calls it "prefect". that's cool, i never knew about that one. 2024-04-04 23:57:47 i'm struggling to imagine when i would ever use that, but i'm sure there's probably some very specific, nuanced, and entirely negligible optimization you can do with it 2024-04-04 23:59:09 i guess if it triggers an entire paragraph to be cached, then maybe you do it before you setup for a loop, and paging more than just the word you asked for happens in parallel before you reach the loop