Sujet : Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!]
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.forthDate : 29. Sep 2024, 19:44:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <878qvacnao.fsf@nightsong.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
dxf <
dxforth@gmail.com> writes:
Perhaps I misunderstood. So we agree Forth locals are unlikely to
ever match C locals for performance?
This I don't know. If the issue is parameter passing in registers,
maybe a fancy enough Forth compiler could do that.
I don't know whether it's possible to make forth code using locals as
efficient as forth code using stack operations. What I do question is
the necessity for it and the wisdom of it.
I think in case of an interpreter, locals might be more efficient, since
as the thread title says, they treat the stack as an array. The
hardware is built to do that, so why not use it? With an optimizing
compiler, I think they should usually be equivalent in principle.
Certainly Forth Inc's early successes didn't rely on the existence of
a standard.
In those days there was only one significant implementation ;).
https://www.ultratechnology.com/antiansi.htm
I remember that from a while back and will look at again. The context
though was a Forth chip with stack hardware, being compared against a
software interpreter.
I miss Jeff but must also remember that he was sometimes prone to
hyperbole.
Do you still use blocks instead of files nowadays?