Sujet : Re: nest-sys revisited
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forthDate : 16. Mar 2025, 16:30:33
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$2d9c6afc$0030a925@cd2cabd68cc02a71>
References : 1 2
User-Agent : Mozilla Thunderbird
On 14-03-2025 02:26, dxf wrote:
On 14/03/2025 3:19 am, albert@spenarnc.xs4all.nl wrote:
Apologize, for bad mouthing nested-sys in the coroutine discussion.
(not that I like this concept).
>
In the ISO 94 document the concept of nest-sys is indeed needed.
...
Unavoidable really. Nesting aka subroutine call - the process of
calling a function and when it completes, returning to the caller -
is a basic computing concept. In forth 'nest-sys' represents the
information necessary to facilitate that return. It should not be
confused with invoking a function i.e. 'xt' EXECUTE.
I agree with most of what you say - except EXECUTE, a "function" can be called, but has to return *somewhere* - otherwise it is a BRANCH (jump).
But that aside. I now know where I went wrong - and I'm sorry for the confusion. I keep forgetting Forth is a SYSTEM standard - and not a LANGUAGE standard.
In (classic) Forth, almost every single word is a subroutine call. When subroutine threaded, you see a long list of CALLs being compiled. Not so in 4tH. In 4tH MOST words are primitives that are not called, but simply the next in line to be executed. Hence, most words in 4tH don't deal with the Return stack - except those who are CALLed, EXECUTEd or EXITed.
Now, I guess this is also largely true for native code Forth compilers, but direct or indirect threaded Forths - I guess that the placing of nest-sys on the Return stack is mostly in the hands of the inner interpreter. So yes, Albert - I understand what you're saying now.
So - I'm sorry for the confusion I caused.
Hans Bezemer