On Nov 30, 3:31 pm, Andrew Haley <andre...@littlepinkcloud.invalid>
wrote:
> > If the claim was that the control flow stack should *normally* be on
> > the data stack, unless there was some specific reason for doing
> > otherwise, that would be one thing. But a claim that the control
> > flow stack should *never* be placed in a separate stack, no matter
> > what the circumstances, that's not a pragmatic rule, its a dogma.
> And which claim was that?
QUOTE: [ >> is Alex McDonald, > is Gerry Jackson ]
How would a separate control-flow stack make things easier for anyone,
let alone a beginner? I really don't see this one.
>> The requirement to
>> have matching stack depths at : and ; is a very minor inconvenience,
> But why have even a minor inconvenience when it is easily avoided?
Partly, it's a philosophical thing. Forth is the way it is because of
a ruthless approach to simplification. It has things that are needed,
and nothing else, or at least that's the idea. Some might argue that
Standard Forth has somewhat deviated from this ideal. ;-)
In any case, it's not that easy to avoid. Every task that can compile
would need its own control-flow stack, and you'd have to find
somewhere to put it.
UNQUOTE
Why we *have to have* have matching stack depths, here, is "a
philosophical thing". That implies that a "ruthless approach to
simplification" will *always* lead to a control-flow stack on the data
stack and data stack depth required to be equal at the beginning and
ending of a colon definition.
That it will *often* lead to that design may well be why we have to
allow for the requirement, as Forth94 does, but the fact that it will
not *always* lead to that design is why we also have to allow for the
possibility that the control flow stack is elsewhere.
Indeed, on hardware where the data stack index is not retrievable,
checking the control-flow stack depth and having the control-flow
stack on the data stack is an either-or design choice.
As far as ruthless simplification and the portability goals of
Forth94, they are in intrinsic goal conflict ~ ruthless simplification
will lead to different specific implementation design decisions for
different specific contexts, and that will increase the complexity of
the task of devising ways to support portable source code for a range
of such implementations.