Deutsch   English   Français   Italiano  
<2024Sep14.143207@mips.complang.tuwien.ac.at>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!]
Date: Sat, 14 Sep 2024 12:32:07 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 26
Message-ID: <2024Sep14.143207@mips.complang.tuwien.ac.at>
References: <nnd$61e0ad9a$48ed61c2@b4d945e456041481> <vasqjd$icjm$1@dont-email.me> <66d26c4b$1@news.ausics.net> <vaubf7$tbke$1@dont-email.me> <nnd$04cff141$0193ba04@301336b8dd8ed69a> <vbfqnd$v4c4$1@dont-email.me> <nnd$26b4d59b$27bdb181@ce638e508b04426e> <87bk0vbvgk.fsf@nightsong.com> <66e0fa58$1@news.ausics.net> <66e11d64$1@news.ausics.net> <877cbh4b6z.fsf@nightsong.com> <66e2a497$1@news.ausics.net>
Injection-Date: Sat, 14 Sep 2024 14:41:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6db5ee5180e7e79132e55bada9f3289b";
	logging-data="1533181"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19XrpeEk9zKLqM1eWWKuWNt"
Cancel-Lock: sha1:CSY6kabR2KeLDBkhctwuGw71+oM=
X-newsreader: xrn 10.11
Bytes: 2071

dxf <dxforth@gmail.com> writes:
>On 12/09/2024 4:51 pm, Paul Rubin wrote:
>> dxf <dxforth@gmail.com> writes:
>https://pastebin.com/2xcRSbQW
> 
>>> SWAP averaged 1 in 7 definitions.  OVER 1 in 9.  Is 'stack juggling' a
>>> problem in forth?  It doesn't appear to be.

: ARG ( n -- adr len -1 | 0 )
  >r  0 0  cmdtail  r> 0 ?do
    2nip
    bl skip  2dup bl scan
    rot over - -rot
  loop 2drop
  dup if  -1  end  and ;

The heavy use of global variables in this program also does not
support the idea that proper usage of the stacks makes locals
unnecessary.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: https://forth-standard.org/
   EuroForth 2024: https://euro.theforth.net