On Monday, October 31, 2022 at 10:33:15 AM UTC-7, Matthias Koch wrote:
One interesting idea would be to design a word-addressed machine, and provide primitives to fetch/store a variable amount of bits or bytes starting from a native word address unit. With this in place, one could in theory resynthesise and recompile both
processor HDL and Forth core for an arbitrary Forth cell width.
Consider Chuck Moore's processor designs. Did he ever support byte addressing? I don't think so. They were all word-addressed (CELL+ same as 1+). Even the Sh-BOOM was word-addressed, with hardware support for packing and unpacking bytes (up to 4 bytes).
ANS assigns a relationship between cell and char addresses. If cell units and char units are not equivalent, the strings paradigm may be broken. You are allowed to mix a-addr and c-addr. That is a dependency. You shouldn't be using @ and ! on a c-addr or
C@ and C! on a c-addr. But you can do it and ANS Forth will not complain. It breaks the "crash early and crash often" rule.
One could have a third address type, bf-addr, which would address bit fields. Due to the limited cell address range (most bits are the mask size and shift count) it would be used with data structures. How to imply the base address of the data structure
in a reentrant way is a topic for discussion. You could use a double for bf-addr (unwieldy), a separate base address stack, keep the base address on the return stack (breaking ANS stack rules), or just use a static variable and forget about reentrancy.
I can only speculate about Chuck's insistence on word addressing, but I would chalk it up to his aversion to cargo cult programming. Perhaps that is the reason he hated ANS.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)