3 ms·
From what I can tell the mental gymnastics are leaning how to think in terms of Forth instead of how to think in terms of the stack, which is the stack effect a
by ofalkaed 1y ago
From what I can tell the mental gymnastics are leaning how to think in terms of Forth instead of how to think in terms of the stack, which is the stack effect and not the stack itself. You only think about the stack itself with your base words (when stack and stack effect are essentially the same), after that it is the stack effect; a single word may push and pop thousands of times but you don't need to think about that, just make sure that it leaves the stack (or stacks) in the state you want it (them). Once you have built up a few layers from the base words I find it more like having a single variable which you store the current state in than a stack, so functional stateless programming but with a tiny dash of state?
There are mental gymnastics but they are far from useless and not just thinking in terms of the stack. I don't quite have it down yet but I am getting closer and can see the sense in it, I haven't quite figured out how to plan and structure a program in Forth.