Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Intelligence without character is a dangerous thing." -- G. Steinem


devel / comp.lang.forth / I made another (slightly longer) video on Forth!

SubjectAuthor
* I made another (slightly longer) video on Forth!Hans Bezemer
`* Re: I made another (slightly longer) video on Forth!Zbig
 `* Re: I made another (slightly longer) video on Forth!Hans Bezemer
  `* Re: I made another (slightly longer) video on Forth!Hans Bezemer
   +* Re: I made another (slightly longer) video on Forth!dxforth
   |`* Re: I made another (slightly longer) video on Forth!Hans Bezemer
   | `* Re: I made another (slightly longer) video on Forth!dxforth
   |  `* Re: I made another (slightly longer) video on Forth!Marcel Hendrix
   |   `* Re: I made another (slightly longer) video on Forth!dxforth
   |    `* Re: I made another (slightly longer) video on Forth!Marcel Hendrix
   |     `* Re: I made another (slightly longer) video on Forth!Anton Ertl
   |      +- Re: I made another (slightly longer) video on Forth!Hans Bezemer
   |      `* Re: I made another (slightly longer) video on Forth!Marcel Hendrix
   |       +- Re: I made another (slightly longer) video on Forth!Hans Bezemer
   |       `* Re: I made another (slightly longer) video on Forth!Anton Ertl
   |        +- Re: I made another (slightly longer) video on Forth!Hans Bezemer
   |        +* Re: I made another (slightly longer) video on Forth!Marcel Hendrix
   |        |`* Keeping the TOS in a register (was: I made another ...)Anton Ertl
   |        | `* Re: Keeping the TOS in a register (was: I made another ...)dxforth
   |        |  `* Re: Keeping the TOS in a register (was: I made another ...)Anton Ertl
   |        |   `* Re: Keeping the TOS in a register (was: I made another ...)dxforth
   |        |    `- Re: Keeping the TOS in a register (was: I made another ...)Anton Ertl
   |        +* Re: I made another (slightly longer) video on Forth!dxforth
   |        |`* Re: I made another (slightly longer) video on Forth!Anton Ertl
   |        | `* Re: I made another (slightly longer) video on Forth!dxforth
   |        |  +* Re: I made another (slightly longer) video on Forth!Anton Ertl
   |        |  |`* Re: I made another (slightly longer) video on Forth!dxforth
   |        |  | +* Re: I made another (slightly longer) video on Forth!Hans Bezemer
   |        |  | |`- Re: I made another (slightly longer) video on Forth!dxforth
   |        |  | `* Re: I made another (slightly longer) video on Forth!Anton Ertl
   |        |  |  `* Re: I made another (slightly longer) video on Forth!Marcel Hendrix
   |        |  |   `* Re: I made another (slightly longer) video on Forth!dxforth
   |        |  |    `* Re: I made another (slightly longer) video on Forth!S Jack
   |        |  |     `- Re: I made another (slightly longer) video on Forth!S Jack
   |        |  `- Re: I made another (slightly longer) video on Forth!Hans Bezemer
   |        `* Re: I made another (slightly longer) video on Forth!none
   |         `- Re: I made another (slightly longer) video on Forth!Anton Ertl
   `- Re: I made another (slightly longer) video on Forth!David Jones

Pages:12
I made another (slightly longer) video on Forth!

<796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18134&group=comp.lang.forth#18134

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:183:b0:301:b1a6:2383 with SMTP id s3-20020a05622a018300b00301b1a62383mr11836557qtw.42.1654014433698;
Tue, 31 May 2022 09:27:13 -0700 (PDT)
X-Received: by 2002:ad4:5dc3:0:b0:462:3a57:b787 with SMTP id
m3-20020ad45dc3000000b004623a57b787mr38167084qvh.117.1654014433176; Tue, 31
May 2022 09:27:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 31 May 2022 09:27:12 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
Subject: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Tue, 31 May 2022 16:27:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1272
 by: Hans Bezemer - Tue, 31 May 2022 16:27 UTC

It's here - https://www.youtube.com/watch?v=hpw__rmBisU

The last one was so much fun to make, I decided to do a few
other ones. Consider this one to be some foundation I can
build on - without having to repeat myself too much in future
videos.

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18135&group=comp.lang.forth#18135

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:e8c7:0:b0:464:48f9:1873 with SMTP id m7-20020a0ce8c7000000b0046448f91873mr10762828qvo.37.1654014955089;
Tue, 31 May 2022 09:35:55 -0700 (PDT)
X-Received: by 2002:a05:620a:17a2:b0:6a5:a7df:a70 with SMTP id
ay34-20020a05620a17a200b006a5a7df0a70mr20616461qkb.570.1654014954873; Tue, 31
May 2022 09:35:54 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 31 May 2022 09:35:54 -0700 (PDT)
In-Reply-To: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Tue, 31 May 2022 16:35:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Zbig - Tue, 31 May 2022 16:35 UTC

> It's here - https://www.youtube.com/watch?v=hpw__rmBisU

01:45 -- but you know: Forth's stack works on the rule „last in — first out”, not „first in, first out”. Or am I wrong?

Re: I made another (slightly longer) video on Forth!

<aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18136&group=comp.lang.forth#18136

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:4e94:0:b0:2fc:7035:3211 with SMTP id 20-20020ac84e94000000b002fc70353211mr21845622qtp.300.1654016774993;
Tue, 31 May 2022 10:06:14 -0700 (PDT)
X-Received: by 2002:a37:9f91:0:b0:6a6:4d21:476a with SMTP id
i139-20020a379f91000000b006a64d21476amr3943196qke.49.1654016774781; Tue, 31
May 2022 10:06:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 31 May 2022 10:06:14 -0700 (PDT)
In-Reply-To: <63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Tue, 31 May 2022 17:06:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1624
 by: Hans Bezemer - Tue, 31 May 2022 17:06 UTC

On Tuesday, May 31, 2022 at 6:35:56 PM UTC+2, Zbig wrote:
> > It's here - https://www.youtube.com/watch?v=hpw__rmBisU
> 01:45 -- but you know: Forth's stack works on the rule „last in — first out”, not „first in, first out”. Or am I wrong?
No, you're not. I pulled it and I'm uploading an updated version.

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18138&group=comp.lang.forth#18138

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:b67:b0:45d:db71:9592 with SMTP id ey7-20020a0562140b6700b0045ddb719592mr51115465qvb.128.1654018605782;
Tue, 31 May 2022 10:36:45 -0700 (PDT)
X-Received: by 2002:a05:622a:d4:b0:302:43:4b46 with SMTP id
p20-20020a05622a00d400b0030200434b46mr11784430qtw.581.1654018605563; Tue, 31
May 2022 10:36:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 31 May 2022 10:36:45 -0700 (PDT)
In-Reply-To: <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Tue, 31 May 2022 17:36:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1765
 by: Hans Bezemer - Tue, 31 May 2022 17:36 UTC

On Tuesday, May 31, 2022 at 7:06:16 PM UTC+2, Hans Bezemer wrote:
> On Tuesday, May 31, 2022 at 6:35:56 PM UTC+2, Zbig wrote:
> > 01:45 -- but you know: Forth's stack works on the rule „last in — first out”, not „first in, first out”. Or am I wrong?
> No, you're not. I pulled it and I'm uploading an updated version.
Second attempt: https://www.youtube.com/watch?v=pnOhRPgFZDI

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<t7bm7s$197$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18176&group=comp.lang.forth#18176

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Fri, 3 Jun 2022 10:56:28 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7bm7s$197$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
<aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="1319"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 3 Jun 2022 00:56 UTC

On 1/06/2022 03:36, Hans Bezemer wrote:
>
> Second attempt: https://www.youtube.com/watch?v=pnOhRPgFZDI

The section on return stack was unexpected - especially for an intro.
Found myself stopping, reversing and going through it again bit by bit.
It's detail I rarely consider; wonder what a beginner would make of it.
Not saying RS function shouldn't be mentioned (SF did IIRC) but wishing
it were paced slower. But then antipodeans prefer everything slower...

Re: I made another (slightly longer) video on Forth!

<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18183&group=comp.lang.forth#18183

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:1c83:b0:443:6749:51f8 with SMTP id ib3-20020a0562141c8300b00443674951f8mr61729913qvb.74.1654247785748;
Fri, 03 Jun 2022 02:16:25 -0700 (PDT)
X-Received: by 2002:a05:620a:3184:b0:6a5:8e2e:766d with SMTP id
bi4-20020a05620a318400b006a58e2e766dmr5610139qkb.482.1654247785620; Fri, 03
Jun 2022 02:16:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 3 Jun 2022 02:16:25 -0700 (PDT)
In-Reply-To: <t7bm7s$197$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Fri, 03 Jun 2022 09:16:25 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Hans Bezemer - Fri, 3 Jun 2022 09:16 UTC

On Friday, June 3, 2022 at 2:56:32 AM UTC+2, dxforth wrote:
> The section on return stack was unexpected - especially for an intro.
> Found myself stopping, reversing and going through it again bit by bit.
It's a stack as well - and I find its mechanism both simple and effective.
That's why I included it.

> It's detail I rarely consider; wonder what a beginner would make of it.
> Not saying RS function shouldn't be mentioned (SF did IIRC) but wishing
> it were paced slower. But then antipodeans prefer everything slower...
As a matter of fact, SF did in great length. It even went so far to do quite
tricky manipulations with it to change program flow. I refrained from that for
two reasons. First its a "new" concept to those watching it and second,
the implications of return stack manipulations are quite mind boggling
for newbies. Heck, when I did my co-routine stuff, I found it quite mind
boggling.

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<t7egbq$1emg$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18188&group=comp.lang.forth#18188

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sat, 4 Jun 2022 12:34:34 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7egbq$1emg$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
<aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>
<t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="47824"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sat, 4 Jun 2022 02:34 UTC

On 3/06/2022 19:16, Hans Bezemer wrote:
> On Friday, June 3, 2022 at 2:56:32 AM UTC+2, dxforth wrote:
>> The section on return stack was unexpected - especially for an intro.
>> Found myself stopping, reversing and going through it again bit by bit.
> It's a stack as well - and I find its mechanism both simple and effective.
> That's why I included it.
>
>> It's detail I rarely consider; wonder what a beginner would make of it.
>> Not saying RS function shouldn't be mentioned (SF did IIRC) but wishing
>> it were paced slower. But then antipodeans prefer everything slower...
> As a matter of fact, SF did in great length. It even went so far to do quite
> tricky manipulations with it to change program flow. I refrained from that for
> two reasons. First its a "new" concept to those watching it and second,
> the implications of return stack manipulations are quite mind boggling
> for newbies. Heck, when I did my co-routine stuff, I found it quite mind
> boggling.

What was in SF was probably tricky (or long-winded) enough that I skipped
over it :) OTOH it makes little sense to tell newcomers forth has a
'return stack' without explaining what it's for. That you did caught me
by surprise as so few intros do.

Is return stack a "new" concept? I've no idea when I first heard about
subroutine calls and stacks but I'm sure it was long before I'd heard of
forth. Perhaps it's different for newcomers today (much like their music).

Re: I made another (slightly longer) video on Forth!

<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18190&group=comp.lang.forth#18190

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:a9c4:0:b0:6a6:8992:e400 with SMTP id s187-20020a37a9c4000000b006a68992e400mr6891723qke.494.1654316578928;
Fri, 03 Jun 2022 21:22:58 -0700 (PDT)
X-Received: by 2002:a05:6214:1c84:b0:461:e0e0:2baf with SMTP id
ib4-20020a0562141c8400b00461e0e02bafmr65694830qvb.59.1654316578828; Fri, 03
Jun 2022 21:22:58 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 3 Jun 2022 21:22:58 -0700 (PDT)
In-Reply-To: <t7egbq$1emg$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:78df:1fb1:bef2:522d;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:78df:1fb1:bef2:522d
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 04 Jun 2022 04:22:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2736
 by: Marcel Hendrix - Sat, 4 Jun 2022 04:22 UTC

On Saturday, June 4, 2022 at 4:34:39 AM UTC+2, dxforth wrote:
[..]
> Is return stack a "new" concept? I've no idea when I first heard about
> subroutine calls and stacks but I'm sure it was long before I'd heard of
> forth. Perhaps it's different for newcomers today (much like their music).

I vividly remember that Forth's implementation techniques were
making understanding it very difficult for me. That was mainly
because it was not explained clearly (or not in a way I could easily
understand). Authors used non-portable aspects of the language
all the time, and it was never explained in depth what the actual
technical advantages of all these different and mind-boggling
tricks (threading methods) were. (At that time it was not yet
possible to Google your way to the heart of even the most esoteric
and difficult concepts.)

At that time I was mainly fascinated by the possibility to use
assembly language from within Forth, and the light came on
(slowly) when I realized that the language essentially boiled
down to generating call-return pairs. It is, for instance, very
easy to explain CREATE DOES> in terms of a call to a
subroutine that uses the return stack pointer to subsequently
load data from the caller's code segment.

-marcel

Re: I made another (slightly longer) video on Forth!

<t7er13$9vv$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18191&group=comp.lang.forth#18191

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sat, 4 Jun 2022 15:36:35 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7er13$9vv$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com>
<aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>
<t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>
<t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="10239"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sat, 4 Jun 2022 05:36 UTC

On 4/06/2022 14:22, Marcel Hendrix wrote:
> On Saturday, June 4, 2022 at 4:34:39 AM UTC+2, dxforth wrote:
> [..]
>> Is return stack a "new" concept? I've no idea when I first heard about
>> subroutine calls and stacks but I'm sure it was long before I'd heard of
>> forth. Perhaps it's different for newcomers today (much like their music).
>
> I vividly remember that Forth's implementation techniques were
> making understanding it very difficult for me. That was mainly
> because it was not explained clearly (or not in a way I could easily
> understand). Authors used non-portable aspects of the language
> all the time, and it was never explained in depth what the actual
> technical advantages of all these different and mind-boggling
> tricks (threading methods) were. (At that time it was not yet
> possible to Google your way to the heart of even the most esoteric
> and difficult concepts.)
>
> At that time I was mainly fascinated by the possibility to use
> assembly language from within Forth, and the light came on
> (slowly) when I realized that the language essentially boiled
> down to generating call-return pairs. It is, for instance, very
> easy to explain CREATE DOES> in terms of a call to a
> subroutine that uses the return stack pointer to subsequently
> load data from the caller's code segment.

I was thinking more fundamentally i.e. forth has a return stack
for the same reason CPUs typically had one. The latter also had
the equivalent of >R ... R> for storing temps! I gather early
processors didn't have a return stack - which may have made it
"new" at the time.

Re: I made another (slightly longer) video on Forth!

<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18192&group=comp.lang.forth#18192

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:20ac:b0:464:66c0:bbe6 with SMTP id 12-20020a05621420ac00b0046466c0bbe6mr15879485qvd.127.1654328313075;
Sat, 04 Jun 2022 00:38:33 -0700 (PDT)
X-Received: by 2002:ac8:5b50:0:b0:2f9:3e39:b75b with SMTP id
n16-20020ac85b50000000b002f93e39b75bmr10902212qtw.60.1654328312944; Sat, 04
Jun 2022 00:38:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 00:38:32 -0700 (PDT)
In-Reply-To: <t7er13$9vv$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:78df:1fb1:bef2:522d;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:78df:1fb1:bef2:522d
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 04 Jun 2022 07:38:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marcel Hendrix - Sat, 4 Jun 2022 07:38 UTC

On Saturday, June 4, 2022 at 7:36:39 AM UTC+2, dxforth wrote:
> On 4/06/2022 14:22, Marcel Hendrix wrote:
> > On Saturday, June 4, 2022 at 4:34:39 AM UTC+2, dxforth wrote:
> > [..]
> >> Is return stack a "new" concept? I've no idea when I first heard about
> >> subroutine calls and stacks but I'm sure it was long before I'd heard of
> >> forth. Perhaps it's different for newcomers today (much like their music).
[..]
> > At that time I was mainly fascinated by the possibility to use
> > assembly language from within Forth, and the light came on
> > (slowly) when I realized that the language essentially boiled
> > down to generating call-return pairs. It is, for instance, very
> > easy to explain CREATE DOES> in terms of a call to a
> > subroutine that uses the return stack pointer to subsequently
> > load data from the caller's code segment.
> I was thinking more fundamentally i.e. forth has a return stack
> for the same reason CPUs typically had one. The latter also had
> the equivalent of >R ... R> for storing temps! I gather early
> processors didn't have a return stack - which may have made it
> "new" at the time.

I am not sure what you mean. Are you hinting that classic Forth
emulated something like the 'link register' the 68000 (and Knuth's
MIX) had?
In iForth I could, instead of CALL-ing primitive A, load the target
return address in register x and then JMP to A. Primitive A simply
jumps to (x) instead of doing a RET. Maybe I should try that...

-marcel

Re: I made another (slightly longer) video on Forth!

<2022Jun4.104612@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18193&group=comp.lang.forth#18193

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sat, 04 Jun 2022 08:46:12 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 36
Message-ID: <2022Jun4.104612@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com> <34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org> <9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org> <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org> <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="e65403301a2727ae7dd500c9111dedff";
logging-data="13072"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18R1vClAZDtTCAvGjZUsTzK"
Cancel-Lock: sha1:v+wmCdjBo8ghx9Qdt3n+v1yEzt4=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sat, 4 Jun 2022 08:46 UTC

Marcel Hendrix <mhx@iae.nl> writes:
>Are you hinting that classic Forth
>emulated something like the 'link register' the 68000 (and Knuth's
>MIX) had?

The 68000 has no link register. It's JSR instruction writes the
return address to memory, and the RTS instruction reads the return
address from memory. The memory is pointed to by the hardware stack
pointer (IIRC A7). Just like on the 8086.

RISC architectures have link registers, either one of the GPRs
(Aarch64, ARM, MIPS, Alpha, SPARC, RISC-V), or a special-purpose
register (PowerPC). For the GPRs-using architectures, in indirect
call instructions, you can choose which GPR to store the return
address to, but for direct calls the register is a specific one (in
order to leave more room in the instruction for the target address).

AFAIK the IBM S/360 also has a link register.

>In iForth I could, instead of CALL-ing primitive A, load the target
>return address in register x and then JMP to A. Primitive A simply
>jumps to (x) instead of doing a RET. Maybe I should try that...

You do that already for calling colon definitions, so if you think
that's the way to go, you might just as well use it for primitives.

But which primitives do you have in mind? I looked at some candidates
(+, MOVE), and they look like they follow the same calling-convention
as colon definitions.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: I made another (slightly longer) video on Forth!

<f914944d-c1d5-48d2-956b-a43e7e22d679n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18194&group=comp.lang.forth#18194

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5c96:0:b0:2f9:3077:5cda with SMTP id r22-20020ac85c96000000b002f930775cdamr11521311qta.625.1654338831747;
Sat, 04 Jun 2022 03:33:51 -0700 (PDT)
X-Received: by 2002:ac8:5a11:0:b0:304:bab8:66f3 with SMTP id
n17-20020ac85a11000000b00304bab866f3mr11127535qta.388.1654338831575; Sat, 04
Jun 2022 03:33:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 03:33:51 -0700 (PDT)
In-Reply-To: <2022Jun4.104612@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f914944d-c1d5-48d2-956b-a43e7e22d679n@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sat, 04 Jun 2022 10:33:51 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Hans Bezemer - Sat, 4 Jun 2022 10:33 UTC

On Saturday, June 4, 2022 at 11:06:51 AM UTC+2, Anton Ertl wrote:
> Marcel Hendrix <m...@iae.nl> writes:
> >Are you hinting that classic Forth
> >emulated something like the 'link register' the 68000 (and Knuth's
> >MIX) had?
> The 68000 has no link register. It's JSR instruction writes the
> return address to memory, and the RTS instruction reads the return
> address from memory. The memory is pointed to by the hardware stack
> pointer (IIRC A7). Just like on the 8086.
>
> RISC architectures have link registers, either one of the GPRs
> (Aarch64, ARM, MIPS, Alpha, SPARC, RISC-V), or a special-purpose
> register (PowerPC). For the GPRs-using architectures, in indirect
> call instructions, you can choose which GPR to store the return
> address to, but for direct calls the register is a specific one (in
> order to leave more room in the instruction for the target address).
>
> AFAIK the IBM S/360 also has a link register.
> >In iForth I could, instead of CALL-ing primitive A, load the target
> >return address in register x and then JMP to A. Primitive A simply
> >jumps to (x) instead of doing a RET. Maybe I should try that...
> You do that already for calling colon definitions, so if you think
> that's the way to go, you might just as well use it for primitives.
>
> But which primitives do you have in mind? I looked at some candidates

Personally, I've always treated 4tHs return stack in the way I knew
from the Z80 - which I was quite familiar with back in the days. And that
concept fitted SF quite nicely.

https://riptutorial.com/assembly/example/17507/zilog-z80-stack

HB

> (+, MOVE), and they look like they follow the same calling-convention
> as colon definitions.
>
> - 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: I made another (slightly longer) video on Forth!

<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18195&group=comp.lang.forth#18195

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:4454:0:b0:69f:c339:e2dc with SMTP id r81-20020a374454000000b0069fc339e2dcmr9087422qka.771.1654339106956;
Sat, 04 Jun 2022 03:38:26 -0700 (PDT)
X-Received: by 2002:a05:6214:500c:b0:462:6c75:9167 with SMTP id
jo12-20020a056214500c00b004626c759167mr38465233qvb.68.1654339106861; Sat, 04
Jun 2022 03:38:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 03:38:26 -0700 (PDT)
In-Reply-To: <2022Jun4.104612@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:78df:1fb1:bef2:522d;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:78df:1fb1:bef2:522d
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 04 Jun 2022 10:38:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3260
 by: Marcel Hendrix - Sat, 4 Jun 2022 10:38 UTC

On Saturday, June 4, 2022 at 11:06:51 AM UTC+2, Anton Ertl wrote:
> Marcel Hendrix <m...@iae.nl> writes:
> >Are you hinting that classic Forth
> >emulated something like the 'link register' the 68000 (and Knuth's
> >MIX) had?
> The 68000 has no link register. It's JSR instruction writes the
> return address to memory, and the RTS instruction reads the return
> address from memory. The memory is pointed to by the hardware stack
> pointer (IIRC A7). Just like on the 8086.

Indeed, 68k has a link instruction, not a link register.

> >In iForth I could, instead of CALL-ing primitive A, load the target
> >return address in register x and then JMP to A. Primitive A simply
> >jumps to (x) instead of doing a RET. Maybe I should try that...
> You do that already for calling colon definitions, so if you think
> that's the way to go, you might just as well use it for primitives.
>
> But which primitives do you have in mind? I looked at some candidates
> (+, MOVE), and they look like they follow the same calling-convention
> as colon definitions.

The problem is that iForth uses the machine stack as the Forth data stack.
Therefore the CALL instruction can't be used without saving RTOS first,
and restoring RTOS before a return. That overhead (for non-inlined words)
goes away with a dedicated link register, but then famous control-flow
modifying tricks like R> DROP would stop working. I assume that these
archaic techniques will be made non-standard at some time, but probably
mxForth (iForth with R-D stacks switched) arrives sooner than that.

-marcel

Re: I made another (slightly longer) video on Forth!

<be987a55-2d31-437b-a3c7-4b92ce0c01ffn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18196&group=comp.lang.forth#18196

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4310:b0:67b:3fc1:86eb with SMTP id u16-20020a05620a431000b0067b3fc186ebmr9685460qko.495.1654343576989;
Sat, 04 Jun 2022 04:52:56 -0700 (PDT)
X-Received: by 2002:a05:620a:258f:b0:680:f657:d3d0 with SMTP id
x15-20020a05620a258f00b00680f657d3d0mr9970760qko.707.1654343576843; Sat, 04
Jun 2022 04:52:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 04:52:56 -0700 (PDT)
In-Reply-To: <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<63395cf2-6e6a-4c69-9062-7c9be671cf1an@googlegroups.com> <aa286af0-e614-4998-83ce-d731885321ban@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <be987a55-2d31-437b-a3c7-4b92ce0c01ffn@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sat, 04 Jun 2022 11:52:56 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2885
 by: Hans Bezemer - Sat, 4 Jun 2022 11:52 UTC

On Saturday, June 4, 2022 at 12:38:28 PM UTC+2, Marcel Hendrix wrote:
> The problem is that iForth uses the machine stack as the Forth data stack.
> Therefore the CALL instruction can't be used without saving RTOS first,
> and restoring RTOS before a return. That overhead (for non-inlined words)
> goes away with a dedicated link register, but then famous control-flow
> modifying tricks like R> DROP would stop working. I assume that these
> archaic techniques will be made non-standard at some time, but probably
> mxForth (iForth with R-D stacks switched) arrives sooner than that.

It's quite courageous to use the machine stack - but I can understand why
you did that and kudos for pulling it off!

I agree that the "old techniques" are dirty and its use should be discouraged.
Although you can pull them off in 4tH, it might pose problems if you don't
know exactly what you're doing because tail call optimization can come in
the way.

On the other hand, some things (like coroutines) can't be done (at least in 4tH)
without it. Still, if I have to weigh them both in, I prefer the clean approach much
more than some fancy thingies.

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<2022Jun4.173139@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18198&group=comp.lang.forth#18198

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sat, 04 Jun 2022 15:31:39 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 69
Message-ID: <2022Jun4.173139@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org> <9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org> <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org> <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="e65403301a2727ae7dd500c9111dedff";
logging-data="16422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VopoY7gM28UlNJDFEz512"
Cancel-Lock: sha1:UJUdablQUnXb3hBAoWTliTB9OtQ=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sat, 4 Jun 2022 15:31 UTC

Marcel Hendrix <mhx@iae.nl> writes:
>Indeed, 68k has a link instruction, not a link register.

IIRC LINK and UNLK deal with stack frames (but are not quite as
complicated as 8086's ENTER and LEAVE).

>The problem is that iForth uses the machine stack as the Forth data stack.
>Therefore the CALL instruction can't be used without saving RTOS first,
>and restoring RTOS before a return. That overhead (for non-inlined words)
>goes away with a dedicated link register, but then famous control-flow
>modifying tricks like R> DROP would stop working. I assume that these
>archaic techniques will be made non-standard at some time

If you mean the Forth standards (Forth-79 etc.), I don't know if they
ever were standard, but they certainly were not in Forth-94. Already
before Forth-94 there were systems such as F-PC where these techniques
didn't work (at least not with "r> drop exit" to return to the
caller's caller), and it does not work in general in SwiftForth
(thanks to tail-call optimization) and in VFX (thanks to inlining):

VFX Forth for Linux IA32 Version: 4.72 [build 0555]
: foo r> drop ; ok
: bar foo ; ok
: flip bar ." end flip." ; ok
: flop flip ." end flop." ; ok
flop end flop. ok

SwiftForth i386-Linux 3.11.0 23-Feb-2021
: foo r> drop ; ok
: bar foo ; ok
: flip bar ." end flip." ; ok
: flop flip ." end flop." ; ok
flop end flop. ok

iforth-5.1-mini:
FORTH> : foo r> drop ; ok
FORTH> : bar foo ; ok
FORTH> : flip bar ." end flip." ; ok
FORTH> : flop flip ." end flop." ; ok
FORTH> flop end flip. ok

That's surprising; so it already does not work in the classical way in
iForth.

Gforth performs no inlining and no tail-call optimization (yet):
: foo r> drop ; ok
: bar foo ; ok
: flip bar ." end flip." ; ok
: flop flip ." end flop." ; ok
flop end flip.end flop. ok

There have been efforts by Gordon Charlton and Michael Gassanenko to
standardize return-address manipulation, but nothing ended up in
Forth-2012. If you are interested in this functionality, they made
some proposals (not formal Forth-200x proposals, though).

>mxForth (iForth with R-D stacks switched)

Given that you tried both, why did you decide to use RSP as data stack
pointer for iForth. Everybody else used RSP for the return stack, and
it looks like the better choice to me, especially because it results
in a better branch prediction for EXIT.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: I made another (slightly longer) video on Forth!

<0a5e5bd9-02de-4d4d-829b-135c37ecc4bfn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18199&group=comp.lang.forth#18199

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5b51:0:b0:304:d815:bfd0 with SMTP id n17-20020ac85b51000000b00304d815bfd0mr10839760qtw.287.1654372013599;
Sat, 04 Jun 2022 12:46:53 -0700 (PDT)
X-Received: by 2002:a05:620a:1a94:b0:6a3:76d1:dc9b with SMTP id
bl20-20020a05620a1a9400b006a376d1dc9bmr11160250qkb.272.1654372013440; Sat, 04
Jun 2022 12:46:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 12:46:53 -0700 (PDT)
In-Reply-To: <2022Jun4.173139@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a5e5bd9-02de-4d4d-829b-135c37ecc4bfn@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sat, 04 Jun 2022 19:46:53 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3272
 by: Hans Bezemer - Sat, 4 Jun 2022 19:46 UTC

On Saturday, June 4, 2022 at 6:03:43 PM UTC+2, Anton Ertl wrote:
> There have been efforts by Gordon Charlton and Michael Gassanenko to
> standardize return-address manipulation, but nothing ended up in
> Forth-2012. If you are interested in this functionality, they made
> some proposals (not formal Forth-200x proposals, though).
I remember this guy! His original paper was
http://www.forth.org.ru/~mlg/ef94/ef94-2-paper.txt

I found this quite compelling, but never fully grasped his concept.
It was remarkable similar to my YIELD library:

\ The implementation of backtracking may be briefly described as following:

\ 1) the residue of the caller procedure threaded code is called continuation;
\ 2) a success is a call of the continuation;
\ 3) a failure is a return from the continuation. (To perform failure a
\ procedure compiled into the continuation should exit both its threaded
\ code and the continuation threaded code).

\ To call the residue of the caller threaded code the callee may execute
\ the code SUCCESS. To perform failure, i.e. exit the code fragment
\ which called the procedure, the callee may perform the code FAIL.
\ Note that since the top return stack item contains the address of
\ continuation, exiting to this address is scarcely meaningful.

\ For example:

\ : 1-10
\ 1
\ BEGIN
\ DUP SUCCESS
\ 1+
\ DUP 11 =
\ UNTIL
\ DROP FAIL
\ ;

\ : X 1-10 . ;

\ Execution of the word X will print numbers from 1 to 10.

\ The technique described above cannot work if we use the return stack to hold
\ temporary data!!

Hans Bezemer

Re: I made another (slightly longer) video on Forth!

<d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18200&group=comp.lang.forth#18200

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4310:b0:67b:3fc1:86eb with SMTP id u16-20020a05620a431000b0067b3fc186ebmr11376586qko.495.1654386890548;
Sat, 04 Jun 2022 16:54:50 -0700 (PDT)
X-Received: by 2002:ad4:4bcb:0:b0:464:692c:6985 with SMTP id
l11-20020ad44bcb000000b00464692c6985mr12546646qvw.48.1654386890386; Sat, 04
Jun 2022 16:54:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 4 Jun 2022 16:54:50 -0700 (PDT)
In-Reply-To: <2022Jun4.173139@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:d6f:2a57:b9ee:b463;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:d6f:2a57:b9ee:b463
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com>
Subject: Re: I made another (slightly longer) video on Forth!
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 04 Jun 2022 23:54:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3399
 by: Marcel Hendrix - Sat, 4 Jun 2022 23:54 UTC

On Saturday, June 4, 2022 at 6:03:43 PM UTC+2, Anton Ertl wrote:
> Marcel Hendrix <m...@iae.nl> writes:
[..]
> Gforth performs no inlining and no tail-call optimization (yet):
> : foo r> drop ; ok
> : bar foo ; ok
> : flip bar ." end flip." ; ok
> : flop flip ." end flop." ; ok
> flop end flip.end flop. ok

In iForth one has to suppress both inlining and tail-call optimizations:
FORTH> : foo r> drop [ -OPT ] ; ok
FORTH> : bar foo [ -OPT ] ; ok
FORTH> : flip bar ." end flip." ; ok
FORTH> : flop flip ." end flop." ; ok
FORTH> flop end flip.end flop. ok

> >mxForth (iForth with R-D stacks switched)
> Given that you tried both, why did you decide to use RSP as data stack
> pointer for iForth. Everybody else used RSP for the return stack, and
> it looks like the better choice to me, especially because it results
> in a better branch prediction for EXIT.

Initially (32-bit era), I was struggling for free registers and didn't want
to give one up for TOS. Also, I didn't like the looks of that optimization.
By the time I started to measure performance in earnest, the code
generator had become so complex that I couldn't change it easily
without years of re-testing. Instead, I invested the time in writing the
64bit version of iForth, with mxForth as a prototype. mxForth was
much faster than iForth64, but the latter could be ported
extremely quickly from iForth32 while the former would have been
a complete rewrite (there were also metacompiler issues). I chose
to get on and concentrate on actually using iForth for my other interests.
As I seem to get closer and closer to the physical limits with circuit
simulation, I may want to pick up mxForth again at some point.

-marcel

Re: I made another (slightly longer) video on Forth!

<t7hbcb$1mcc$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18201&group=comp.lang.forth#18201

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sun, 5 Jun 2022 14:27:56 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7hbcb$1mcc$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<34dc0a19-6e15-4ad9-a48d-b39c4d499e7fn@googlegroups.com>
<t7bm7s$197$1@gioia.aioe.org>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>
<t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>
<t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>
<2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
<2022Jun4.173139@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="55692"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sun, 5 Jun 2022 04:27 UTC

On 5/06/2022 01:31, Anton Ertl wrote:
> ...
> If you mean the Forth standards (Forth-79 etc.), I don't know if they
> ever were standard, but they certainly were not in Forth-94. Already
> before Forth-94 there were systems such as F-PC where these techniques
> didn't work (at least not with "r> drop exit" to return to the
> caller's caller), and it does not work in general in SwiftForth
> (thanks to tail-call optimization) and in VFX (thanks to inlining):

Did they try? It's not clear to me Forth-94 TC ever considered it -
unless a reader wishes to read it into their statement:

'A program shall not access values on the return stack that it did
not place there'

It's almost biblical.

"The tree of knowledge of good and evil, thou shalt not eat of it."

R> DROP EXIT may not qualify as a beginner's technique, nor easy to debug,
nor frequently used etc but apparently it was known and applied:

From: fish@ecst.csuchico.edu (Kevin Haddock)
Subject: Re: More Forth-in-C opinions...
Date: 18 Jun 1993 15:38:45 GMT
NNTP-Posting-Host: cscihp.ecst.csuchico.edu

In article <1vs5iv$sto@nz12.rz.uni-karlsruhe.de> DAHMS@ifk20.mach.uni-karlsruhe.de (Heribert Dahms) writes:
>In <1vpg81INNe16@charnel.ecst.csuchico.edu> fish@ecst.csuchico.edu writes:
>
>: [...]
>R> DROP EXIT is explicitely forbidden by dpANS Forth !

[...]
R> DROP EXIT in most of the polyFORTH code I've seen is about as common
as the 'break' statement in C (and is roughly the equivalent).

Don't flame me, I'm just making an observation!

-Kevin

If Forth is about getting results using the simplest possible means then IMO
it should have been included. I came upon it unwittingly when coding the
example I describe here:

http://dxforth.mirrors.minimaltype.com/unnest.html

Re: I made another (slightly longer) video on Forth!

<nnd$124c4b92$1df0b6e2@b2fa80acc208e1e6>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18202&group=comp.lang.forth#18202

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at>
Subject: Re: I made another (slightly longer) video on Forth!
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$124c4b92$1df0b6e2@b2fa80acc208e1e6>
Organization: KPN B.V.
Date: Sun, 05 Jun 2022 09:23:22 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!94.232.112.244.MISMATCH!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 28
Injection-Date: Sun, 05 Jun 2022 09:23:22 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Sun, 5 Jun 2022 07:23 UTC

In article <2022Jun4.173139@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
<SNIP>
>
>Given that you tried both, why did you decide to use RSP as data stack
>pointer for iForth. Everybody else used RSP for the return stack, and
>it looks like the better choice to me, especially because it results
>in a better branch prediction for EXIT.

8086 fig-Forth and all their derivatives uses the real data stack.
16 bit models fig-Forth uses segments to their advantage to break
the 64 kbyte limit. That is not easily changed.
iForth and for that matter ciforth never changed that.

I have found an effective DLL activation on MS-Windows in
32/64 ciforth. I'm not sure how good this works if EXSP is not the
real data stack.

>
>- anton

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: I made another (slightly longer) video on Forth!

<2022Jun5.100536@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18203&group=comp.lang.forth#18203

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sun, 05 Jun 2022 08:05:36 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 74
Message-ID: <2022Jun5.100536@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <t7bm7s$197$1@gioia.aioe.org> <9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org> <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org> <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at> <t7hbcb$1mcc$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="538297141c77b381fdf0526a6df3daa8";
logging-data="7917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JpqTfrC1s7vCbLe4jPB5V"
Cancel-Lock: sha1:to/ad8BB1EobCgnvXK1A37Vk8/s=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Jun 2022 08:05 UTC

dxforth <dxforth@gmail.com> writes:
>On 5/06/2022 01:31, Anton Ertl wrote:
>> ...
>> If you mean the Forth standards (Forth-79 etc.), I don't know if they
>> ever were standard, but they certainly were not in Forth-94. Already
>> before Forth-94 there were systems such as F-PC where these techniques
>> didn't work (at least not with "r> drop exit" to return to the
>> caller's caller), and it does not work in general in SwiftForth
>> (thanks to tail-call optimization) and in VFX (thanks to inlining):
>
>Did they try?

Did who try?

>It's not clear to me Forth-94 TC ever considered it -

Given that return-address manipulation is a well-known technique and
not extremely rare (as can also be seen by the repeated discussions
about the topic here, and by Marcel Hendrix' assumption that it is
standardized), I expect that they considered it, and decided against
standardizing it.

>unless a reader wishes to read it into their statement:
>
> 'A program shall not access values on the return stack that it did
> not place there'

More exactly (from 3.2.3.3):

|A program shall not access values on the return stack (using R@, R>,
|2R@, 2R> or NR>) that it did not place there using >R, 2>R or N>R;

>It's almost biblical.

The use of "shall" is normal standards language. Forth-94 usually
uses a different style: It describes how a standard system behaves
when processing a standard program; and basically anything outside
this description is non-standard: If a program relies on a behaviour
that's not guaranteed in the standard, it is non-standard; and if a
system behaves in a way incompatible with the requirements of the
standard, it is non-standard. I usually prefer that style.

All the restrictions spelled out explicitly with "shall not" and
"shall" in 3.2.3.3 are consequences of (from 3.1.5.2 System-execution
types):

|These data types denote zero or more items on the return stack.

Apparently the Forth-94 committee felt it necessary to spell out these
consequences explicitly in the face of well-known return-address
manipulation (and maybe also loop-control parameter manipulation,
although that seems to be much less popular) techniques.

>If Forth is about getting results using the simplest possible means then IMO
>it should have been included.

Somehow people manage to get results without return-address
manipulation (or are happy enough with system-specific ways to perform
them) or F-PC, iForth, SwiftForth, VFX, cmForth, machineForth, and
colorForth would have supported R> DROP EXIT by default; they don't
(at least not with the same results as you see on, say fig-Forth).
Given the lack of common practice these days, I expect that that ship
has sailed, but if you feel like it, you can try proposing support for
that feature.

Alternatively, you can implement that feature in your system (it
probably is already there) and document it as a feature.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: I made another (slightly longer) video on Forth!

<2022Jun5.105855@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18204&group=comp.lang.forth#18204

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: I made another (slightly longer) video on Forth!
Date: Sun, 05 Jun 2022 08:58:55 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 30
Message-ID: <2022Jun5.105855@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at> <nnd$124c4b92$1df0b6e2@b2fa80acc208e1e6>
Injection-Info: reader02.eternal-september.org; posting-host="538297141c77b381fdf0526a6df3daa8";
logging-data="7917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/amsCpDulIyRZ7s5XtIhrM"
Cancel-Lock: sha1:dr1/OMb/bYeoIwWimEXmlQD280o=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Jun 2022 08:58 UTC

albert@cherry.(none) (albert) writes:
>8086 fig-Forth and all their derivatives uses the real data stack.

You mean they use SP as the data stack pointer.

>16 bit models fig-Forth uses segments to their advantage to break
>the 64 kbyte limit.

I don't see that in the fig-Forth listing, and I doubt that played a
role for that question. If they had used SP for the return stack
instead of the data stack, they would have broken the limit, too, and
by a similar (small) amount (typical data and return stack depths are <30).

I expect that the much more relevant issue for 8086 fig-Forth is that
there are many more data-stack accesses than return-stack accesses,
and thus making use of POP and PUSH saved code space and (on the 8086
and 8088) execution time.

>I have found an effective DLL activation on MS-Windows in
>32/64 ciforth. I'm not sure how good this works if EXSP is not the
>real data stack.

VFX and SwiftForth seem to have no problems.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Keeping the TOS in a register (was: I made another ...)

<2022Jun5.111403@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18205&group=comp.lang.forth#18205

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Keeping the TOS in a register (was: I made another ...)
Date: Sun, 05 Jun 2022 09:14:03 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 59
Message-ID: <2022Jun5.111403@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com> <t7egbq$1emg$1@gioia.aioe.org> <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org> <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at> <d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="538297141c77b381fdf0526a6df3daa8";
logging-data="25219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BgoYYKaQ9SJLYCOmXhAcL"
Cancel-Lock: sha1:NShA38Ku/PSEbRFY4hKla/Zqnm4=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Jun 2022 09:14 UTC

Marcel Hendrix <mhx@iae.nl> writes:
>Initially (32-bit era), I was struggling for free registers and didn't want
>to give one up for TOS.

We also have this problem on the 386 (as has everybody else).
However, after many years I noticed that keeping the TOS in a register
does not really increase register pressure. The reason is that you
keep the TOS in a register between the end of one word and the start
of the next; there are a few cases to consider:

* for data-stack words, the TOS can be

- alive throughout the a data-stack word (e.g., +), so if you do not
keep it in a register, you memory-pop it at the start of the word and
memory-push it at the end. Keeping it alive across words does not
increase register pressure.

- dead at the start of a data-stack word (e.g., R@). So if you keep the
TOS in a register, you memory-push it at the start, and are in the
same situation wrt. register pressure as if you had not kept the
TOS in a register.

- dead at the end of a data-stack word (e.g., !). If you keep the
TOS in a register, you have to memory-pop it at the end, but
before that, you are in the same situation wrt. register pressure
as if you had not kept the TOS in a register.

* So the only words where keeping the TOS in a register makes a real
difference to register pressure are those that don't access the data
stack at all, such as ;S/EXIT or F+. However, for these words
general-purpose register pressure tends not to be a problem.

This is from the perspective of a simple Forth system, but even with
an analytic compiler (like iForth, lxf and VFX), the reasoning is
similar, only at the level of colon definitions rather than
primitives.

>Also, I didn't like the looks of that optimization.
>By the time I started to measure performance in earnest, the code
>generator had become so complex that I couldn't change it easily
>without years of re-testing. Instead, I invested the time in writing the
>64bit version of iForth, with mxForth as a prototype. mxForth was
>much faster than iForth64, but the latter could be ported
>extremely quickly from iForth32 while the former would have been
>a complete rewrite (there were also metacompiler issues). I chose
>to get on and concentrate on actually using iForth for my other interests.
>As I seem to get closer and closer to the physical limits with circuit
>simulation, I may want to pick up mxForth again at some point.

Interesting, thanks. I guess that, with aggressive inlining, returns
are rare enough that the misprediction disadvantage plays a small
role.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: Keeping the TOS in a register (was: I made another ...)

<t7i4c0$5o4$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18206&group=comp.lang.forth#18206

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Keeping the TOS in a register (was: I made another ...)
Date: Sun, 5 Jun 2022 21:34:23 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7i4c0$5o4$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<9625393f-40db-4e19-bd6d-9f44dd963410n@googlegroups.com>
<t7egbq$1emg$1@gioia.aioe.org>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>
<t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>
<2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
<2022Jun4.173139@mips.complang.tuwien.ac.at>
<d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com>
<2022Jun5.111403@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="5892"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 5 Jun 2022 11:34 UTC

On 5/06/2022 19:14, Anton Ertl wrote:
> Marcel Hendrix <mhx@iae.nl> writes:
>>Initially (32-bit era), I was struggling for free registers and didn't want
>>to give one up for TOS.
>
> We also have this problem on the 386 (as has everybody else).
> However, after many years I noticed that keeping the TOS in a register
> does not really increase register pressure. The reason is that you
> keep the TOS in a register between the end of one word and the start
> of the next; there are a few cases to consider:
>
> * for data-stack words, the TOS can be
>
> - alive throughout the a data-stack word (e.g., +), so if you do not
> keep it in a register, you memory-pop it at the start of the word and
> memory-push it at the end. Keeping it alive across words does not
> increase register pressure.
>
> - dead at the start of a data-stack word (e.g., R@). So if you keep the
> TOS in a register, you memory-push it at the start, and are in the
> same situation wrt. register pressure as if you had not kept the
> TOS in a register.
>
> - dead at the end of a data-stack word (e.g., !). If you keep the
> TOS in a register, you have to memory-pop it at the end, but
> before that, you are in the same situation wrt. register pressure
> as if you had not kept the TOS in a register.
>
> * So the only words where keeping the TOS in a register makes a real
> difference to register pressure are those that don't access the data
> stack at all, such as ;S/EXIT or F+. However, for these words
> general-purpose register pressure tends not to be a problem.
>
> This is from the perspective of a simple Forth system, but even with
> an analytic compiler (like iForth, lxf and VFX), the reasoning is
> similar, only at the level of colon definitions rather than
> primitives.

An 8080 has three 16-bit registers and 8-bit accumulator. An ITC
NEXT will use all of them:

NEXT LDAX B
INX B
MOV L,A
LDAX B
INX B
MOV H,A
MOV E,M
INX H
MOV D,M
XCHG
PCHL

It might be possible to keep IP in memory but that will only slow down
NEXT. ISTM keeping TOS in a register is predicated on having enough free
ones to begin with. IOW TOS in register is not the highest priority.

Re: Keeping the TOS in a register (was: I made another ...)

<2022Jun5.153340@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18209&group=comp.lang.forth#18209

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Keeping the TOS in a register (was: I made another ...)
Date: Sun, 05 Jun 2022 13:33:40 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 90
Message-ID: <2022Jun5.153340@mips.complang.tuwien.ac.at>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com> <2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com> <t7er13$9vv$1@gioia.aioe.org> <cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com> <2022Jun4.104612@mips.complang.tuwien.ac.at> <cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com> <2022Jun4.173139@mips.complang.tuwien.ac.at> <d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com> <2022Jun5.111403@mips.complang.tuwien.ac.at> <t7i4c0$5o4$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="538297141c77b381fdf0526a6df3daa8";
logging-data="3719"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oPdBkhIRzx5dhSqRm181U"
Cancel-Lock: sha1:pkPLcpkL/ha+0ffYd4vMXFUHIns=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Jun 2022 13:33 UTC

dxforth <dxforth@gmail.com> writes:
>An 8080 has three 16-bit registers and 8-bit accumulator. An ITC
>NEXT will use all of them:
>
>NEXT LDAX B
> INX B
> MOV L,A
> LDAX B
> INX B
> MOV H,A
> MOV E,M
> INX H
> MOV D,M
> XCHG
> PCHL
>
>It might be possible to keep IP in memory but that will only slow down
>NEXT. ISTM keeping TOS in a register is predicated on having enough free
>ones to begin with. IOW TOS in register is not the highest priority.

IP certainly has a higher priority, and if all the registers you have
are needed in NEXT, then obviously the considerations above don't
apply, because they are predicated on being able to keep the TOS in a
register without slowing down NEXT.

Anyway, we were discussing the 80386, not the 8080. Even if we take
the in-between 8086, I see in "Inside F83" the following register
allocation:

BX=W
SP=SP
BP=RP
SI=IP

AX, CX, DX, and DI are scratch registers

NEXT destroys AX, so let's leave that alone.

One might use DI as TOS, allowing to replace F83's

CODE @ ( addr -- n )
BX POP
0 [BX] PUSH
NEXT
END-CODE

by

CODE @ ( addr -- n )
DI 0 [DI] MOV
NEXT
END-CODE

and (I expanded the 1PUSH makro to make the cost of 1PUSH obvious):

CODE + (S n1 n2 -- sum )
BX POP AX POP BX AX ADD AX PUSH NEXT END-CODE
CODE NEGATE (S n -- n' )
AX POP AX NEG AX PUSH NEXT END-CODE

by

CODE + (S n1 n2 -- sum )
AX POP AX DI ADD NEXT END-CODE
CODE NEGATE (S n -- n' )
DI NEG NEXT END-CODE

Shorter and faster.

However, I have to admit that my argument why keeping the TOS in a
register does not increase register pressure does not hold in these
cases, because in these cases only registers AX and BX are used within
a word that NEXT uses anyway.

However, if you consider the direct-threaded NEXT of gforth-fast 0.6.2
(compiled with gcc-2.95), the only register involved is IP (in ebx):

add ebx , # 4
jmp dword ptr -4 [ebx]

(This is in a setup (primitive-centric hybrid direct/indirect threaded
code) where words called with NEXT don't need W. In this setup the
argument certainly is true.

- 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 2022: http://www.euroforth.org/ef22/cfp.html

Re: Keeping the TOS in a register (was: I made another ...)

<t7js2m$1li9$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18212&group=comp.lang.forth#18212

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Keeping the TOS in a register (was: I made another ...)
Date: Mon, 6 Jun 2022 13:25:09 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t7js2m$1li9$1@gioia.aioe.org>
References: <796e188d-3462-419c-9ddf-7bedb14f0634n@googlegroups.com>
<2c3acc4f-ad26-4c66-9cda-26afbf7e1f4en@googlegroups.com>
<t7er13$9vv$1@gioia.aioe.org>
<cd36e152-b57d-439d-a02d-64a821c9bfc5n@googlegroups.com>
<2022Jun4.104612@mips.complang.tuwien.ac.at>
<cc6069c5-91ea-417d-8a68-550cdc7a9d58n@googlegroups.com>
<2022Jun4.173139@mips.complang.tuwien.ac.at>
<d68de794-be0a-4cab-af07-11c4316cd615n@googlegroups.com>
<2022Jun5.111403@mips.complang.tuwien.ac.at> <t7i4c0$5o4$1@gioia.aioe.org>
<2022Jun5.153340@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54857"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Mon, 6 Jun 2022 03:25 UTC

On 5/06/2022 23:33, Anton Ertl wrote:
> ...
> Anyway, we were discussing the 80386, not the 8080. Even if we take
> the in-between 8086, I see in "Inside F83" the following register
> allocation:
>
> BX=W
> SP=SP
> BP=RP
> SI=IP
>
> AX, CX, DX, and DI are scratch registers
>
> NEXT destroys AX, so let's leave that alone.
>
> One might use DI as TOS, allowing to replace F83's
> ...

I could have gone with TOS in register when DX-Forth moved from
8080 to 8086 but it was never a serious consideration - perhaps
because I'd be looking at 15% speed improvement max and I was
already using an inline NEXT. Some years later I did create a
kernel with TOS in BX just to see what it would take. I recall
it wasn't particularly hard. However to make the change at that
point in time, invalidating anything that used assembler, I felt
was more trouble than worth. I'd only do it were I starting a
new forth and even then the gain would be marginal.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor