Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!] Date: Sun, 29 Sep 2024 11:44:31 -0700 Organization: A noiseless patient Spider Lines: 31 Message-ID: <878qvacnao.fsf@nightsong.com> References: <66d26c4b$1@news.ausics.net> <87bk0vbvgk.fsf@nightsong.com> <66e0fa58$1@news.ausics.net> <66e11d64$1@news.ausics.net> <877cbh4b6z.fsf@nightsong.com> <2024Sep12.105526@mips.complang.tuwien.ac.at> <87seu01zbj.fsf@nightsong.com> <2024Sep16.182651@mips.complang.tuwien.ac.at> <66ea4436$1@news.ausics.net> <874j6d1pw8.fsf@nightsong.com> <66ea8196$1@news.ausics.net> <87zfo4zps8.fsf@nightsong.com> <66eba538$1@news.ausics.net> <87h69zcxlh.fsf@nightsong.com> <66f8d602@news.ausics.net> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 29 Sep 2024 20:44:31 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2f881d26a6f94e9bd1e19c8f3a5f18ce"; logging-data="1948046"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jAMc7Fj1c0yLDBY+wqSlS" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:NITrvAsmLRuO3hwdfpKLL4hDNR0= sha1:Jo4p06XaRE8jdsGPcMPcCP/XL44= Xref: csiph.com comp.lang.forth:132361 dxf 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?