Max string length 256 bytes #461
Replies: 2 comments 1 reply
-
AIUI, the reason it's 2 bytes is because The 8-bit count is a common and well defined format (counted string), and short strings are the more common case. It wouldn't be totally unreasonable to let compilation of longer strings perform an extra move as data overflows from 8-bit to 16-bit length, or even vice versa. But the flexibility of such a dynamic length It looks to me like the base system has almost no uses of The standard parsing section does allow a limit to the counted string length. So I think reducing these words to 8-bit lengths is compliant. Shorter than the counted length isn't permitted, though, so given the size of our input buffers we still need the refill ability of getc. I think it would make sense given common uses to have the core |
Beta Was this translation helpful? Give feedback.
-
Going back in time, originally only 256 bytes string length was allowed. This was expanded to 65536 bytes for the MML support. In hindsight, I think this was the wrong thing to do. 256 is normal for 8-bit Forths, and supported by the standard. |
Beta Was this translation helpful? Give feedback.
-
I am (again) toying with the idea to make max string length 256 bytes.
Good: Saves one byte per string definition.
Bad: MML definitions will have to move to files.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions