Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Theory is gray, but the golden tree of life is green. -- Goethe


devel / comp.lang.forth / Re: Not really locals

SubjectAuthor
* Not really localsPaul Rubin
+* Re: Not really localsPaul Rubin
|`- Re: Not really localsHans Bezemer
+- Re: Not really localsMarcel Hendrix
+* Re: Not really localsAnton Ertl
|+- Re: Not really localsP Falth
|`* Re: Not really localsdxforth
| +* Re: Not really localsPaul Rubin
| |`* Re: Not really localsdxforth
| | `* Re: Not really localsPaul Rubin
| |  +* Re: Not really localsMarcel Hendrix
| |  |`- Re: Not really localsAnton Ertl
| |  +* Re: Not really localsdxforth
| |  |`- Re: Not really localsPaul Rubin
| |  `* Re: Not really localsAndy Valencia
| |   `* Re: Not really localsdxforth
| |    `* Re: Not really localsPaul Rubin
| |     `* Re: Not really localsdxforth
| |      `* Re: Not really localsPaul Rubin
| |       `- Re: Not really localsdxforth
| `* Re: Not really localsDoug Hoffman
|  `* Re: Not really localsPaul Rubin
|   `* Re: Not really localsAnton Ertl
|    +* Re: Not really localsDoug Hoffman
|    |`- Re: Not really localsAnton Ertl
|    `* Re: Not really localsPaul Rubin
|     +* Re: Not really localsdxforth
|     |`* Re: Not really localsPaul Rubin
|     | +* Re: Not really localsdxforth
|     | |`- Re: Not really localsPaul Rubin
|     | +* Re: Not really localsHans Bezemer
|     | |+* Re: Not really localsHugh Aguilar
|     | ||`* Re: Not really localsdxforth
|     | || `* Re: Not really localsHugh Aguilar
|     | ||  `* Re: Not really localsdxforth
|     | ||   `* Re: Not really localsHugh Aguilar
|     | ||    `- Re: Not really localsdxforth
|     | |`* Re: Not really localsPaul Rubin
|     | | `* Re: Not really localsdxforth
|     | |  `* Re: Not really localsPaul Rubin
|     | |   +- Re: Not really localsdxforth
|     | |   +- Re: Not really localsHugh Aguilar
|     | |   `* Re: Not really localsdxforth
|     | |    `* Re: Not really localsPaul Rubin
|     | |     `* Re: Not really localsdxforth
|     | |      `* Re: Not really localsPaul Rubin
|     | |       `* Re: Not really localsdxforth
|     | |        `* Re: Not really localsPaul Rubin
|     | |         `* Re: Not really localsHans Bezemer
|     | |          +* Re: Not really localsminf...@arcor.de
|     | |          |`* Re: Not really localsdxforth
|     | |          | +- Re: Not really localsminf...@arcor.de
|     | |          | `- Re: Not really localsHans Bezemer
|     | |          +* Re: Not really localsPaul Rubin
|     | |          |`* Re: Not really localsdxforth
|     | |          | `* Re: Not really localsPaul Rubin
|     | |          |  +* Re: Not really localsdxforth
|     | |          |  |+* Re: Not really localsS Jack
|     | |          |  ||`- Re: Not really localsHugh Aguilar
|     | |          |  |`- Re: Not really localsPaul Rubin
|     | |          |  `* Re: Not really localsdxforth
|     | |          |   +* Re: Not really localsPaul Rubin
|     | |          |   |+- Re: Not really localsdxforth
|     | |          |   |`* Re: Not really localsHans Bezemer
|     | |          |   | `* Re: Not really localsHans Bezemer
|     | |          |   |  +* Re: Not really localsPaul Rubin
|     | |          |   |  |+- Re: Not really localsPaul Rubin
|     | |          |   |  |`* Re: Not really localsminf...@arcor.de
|     | |          |   |  | +* Re: Not really localsPaul Rubin
|     | |          |   |  | |`* Re: Not really localsHans Bezemer
|     | |          |   |  | | +* Re: Not really localsdxforth
|     | |          |   |  | | |`- Re: Not really localsdxforth
|     | |          |   |  | | `* Re: Not really localsPaul Rubin
|     | |          |   |  | |  +* Re: Not really localsHans Bezemer
|     | |          |   |  | |  |`- Re: Not really localsPaul Rubin
|     | |          |   |  | |  `- Re: Not really localsdxforth
|     | |          |   |  | `* Re: Not really localsAndy Valencia
|     | |          |   |  |  +* Re: Not really localsMarcel Hendrix
|     | |          |   |  |  |+- Re: Not really localsAnton Ertl
|     | |          |   |  |  |`- Re: Not really localsS Jack
|     | |          |   |  |  +* Re: Not really localsAndy Valencia
|     | |          |   |  |  |+- Re: Not really localsdxforth
|     | |          |   |  |  |+* Re: Not really localsMarcel Hendrix
|     | |          |   |  |  ||`- Re: Not really localsminf...@arcor.de
|     | |          |   |  |  |`- Re: Not really localsAndy Valencia
|     | |          |   |  |  `* Re: Not really localsHans Bezemer
|     | |          |   |  |   `* Re: Not really localsPaul Rubin
|     | |          |   |  |    +* Re: Not really localsAnton Ertl
|     | |          |   |  |    |`* Re: Not really localsHans Bezemer
|     | |          |   |  |    | +* Re: Not really localsPaul Rubin
|     | |          |   |  |    | |+- Re: Not really localsdxforth
|     | |          |   |  |    | |+* static type checking (was: Not really locals)Anton Ertl
|     | |          |   |  |    | ||`- Re: static type checkingPaul Rubin
|     | |          |   |  |    | |`* Re: Not really localsS Jack
|     | |          |   |  |    | | +- Re: Not really localsDoug Hoffman
|     | |          |   |  |    | | `- Re: Not really localsdxforth
|     | |          |   |  |    | `* Re: Not really localsAnton Ertl
|     | |          |   |  |    |  +- Re: Not really localsHans Bezemer
|     | |          |   |  |    |  `* Re: Not really localsPaul Rubin
|     | |          |   |  |    |   +* Re: Not really localsHans Bezemer
|     | |          |   |  |    |   |`- Re: Not really localsdxforth
|     | |          |   |  |    |   +* Re: Not really localsS Jack
|     | |          |   |  |    |   `- Re: Not really localsdxforth
|     | |          |   |  |    `* Re: Not really localsdxforth
|     | |          |   |  `* Re: Not really localsdxforth
|     | |          |   `- Re: Not really localsAnton Ertl
|     | |          `* Re: Not really localsRuvim
|     | +- Re: Not really localsMarcel Hendrix
|     | `- Re: Not really localsMarcel Hendrix
|     `* Re: Not really localsAnton Ertl
+* Re: Not really localsS Jack
`- Re: Not really localsHugh Aguilar

Pages:1234567
Re: Not really locals

<2021Sep3.120548@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Not really locals
Date: Fri, 03 Sep 2021 10:05:48 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 42
Message-ID: <2021Sep3.120548@mips.complang.tuwien.ac.at>
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
Injection-Info: reader02.eternal-september.org; posting-host="47443575209a8dec73de98d33bb6ff7f";
logging-data="2229"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RK47RY4FTW7zJXBCWMm16"
Cancel-Lock: sha1:71F8LKVkjXhBuamcGlC1mW5oIFU=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 3 Sep 2021 10:05 UTC

Paul Rubin <no.email@nospam.invalid> writes:
>Doug Hoffman <dhoffman888@gmail.com> writes:
>> This always reminds me of the old blocks vs text files debate.
>
>I wasn't around for that but I think blocks have mostly faded away by
>now. Did they really have staunch proponents?

The topic managed to get into the "Flame baits" category of the FAQ:

http://www.complang.tuwien.ac.at/forth/faq/faq-general-4.html#ss4.3

>Was there a similar
>debate over 3+length vs. storing the whole name in the dictionary?

Not on comp.lang.forth ever since I read it first in ~1988. There is
the article by Chuck Moore in Forth Dimensions where he argued for
3+length. In a way, you see a bit of that still in colorForth, which
stores only as much of a name as fits in a fixed number of bits (but
using a variable-length encoding for characters).

It seems to me that both topics have to do with the technological
environment (native vs. hosted systems for blocks vs. files; RAM size
for 3+length), and when that changed, the preferences changed, and the
discussions were the transition pains.

>I wonder if the
>absence of locals in early Forth was something like the 3+length
>dictionary, i.e. an artifact of memory being scarce in those days.

To some extent, it is. But the 3+length discussion has been over for
more than three decades, while the locals discussion is still alive.
I think the reason is that full-length names mainly cost RAM, which
has become cheaper over time, while locals also (or mainly?) cost
implementation effort and Forth system complexity, which does not
become cheaper over time.

- 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: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Not really locals

<61320b92$0$701$14726298@news.sunsite.dk>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Subject: Re: Not really locals
Newsgroups: comp.lang.forth
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
From: dhoffman...@gmail.com (Doug Hoffman)
Date: Fri, 3 Sep 2021 07:48:33 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <2021Sep3.120548@mips.complang.tuwien.ac.at>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Lines: 34
Message-ID: <61320b92$0$701$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 483ed8b1.news.sunsite.dk
X-Trace: 1630669714 news.sunsite.dk 701 glidedog@gmail.com/68.55.82.126:63508
X-Complaints-To: staff@sunsite.dk
 by: Doug Hoffman - Fri, 3 Sep 2021 11:48 UTC

On 9/3/21 6:05 AM, Anton Ertl wrote:
> Paul Rubin <no.email@nospam.invalid> writes:
>> Doug Hoffman <dhoffman888@gmail.com> writes:
>>> This always reminds me of the old blocks vs text files debate.
>>
>> I wasn't around for that but I think blocks have mostly faded away by
>> now. Did they really have staunch proponents?

Yes, and they still do. There is valid logic to using blocks files: They
discourage long definitions so short, well factored definitions tend to
get used. This is not a bad thing. My first Forth was blocks files only
and I found using blocks to be not a big problem though I switched to
text files when I could. I think today it's primarily a matter of
personal preference. But since this is on a FAQ "flame bait" list I have
already violated what that list tries to do. So I'll say no more.

> The topic managed to get into the "Flame baits" category of the FAQ:
>
> http://www.complang.tuwien.ac.at/forth/faq/faq-general-4.html#ss4.3

> ... while locals also (or mainly?) cost implementation effort and
> Forth system complexity, which does not become cheaper over time.
The implementation effort and complexity was and never will be an issue
for me since I don't implement a Forth and never will. The "flame bait"
FAQ lists the ordering as the reason for locals controversy. While
perhaps true at one time, I think the locals use controversy goes deeper
than that. I see locals as just another tool. Use them to solve certain
problems but don't over use them. Again, not wanting to be a flame
baiter I'll leave it at that.

-Doug

Re: Not really locals

<2021Sep3.151859@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!paganini.bofh.team!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: Not really locals
Date: Fri, 03 Sep 2021 13:18:59 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 24
Message-ID: <2021Sep3.151859@mips.complang.tuwien.ac.at>
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at> <61320b92$0$701$14726298@news.sunsite.dk>
Injection-Info: reader02.eternal-september.org; posting-host="47443575209a8dec73de98d33bb6ff7f";
logging-data="4657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cfnYW8n1EGRnaw0g720dc"
Cancel-Lock: sha1:EhiNESmk4TjFbVeWUNd2qbaRHYw=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 3 Sep 2021 13:18 UTC

Doug Hoffman <dhoffman888@gmail.com> writes:
>The "flame bait"
>FAQ lists the ordering as the reason for locals controversy.

The ordering has been resolved with the acceptance of {: ... :}.
There are a few who use (prefer?) the LOCALS| ordering, but most
prefer the {: ordering, and there have not been flame wars about that
in recent years.

>While
>perhaps true at one time, I think the locals use controversy goes deeper
>than that.

Yes. It's interesting that it's not mentioned in the Flame baits part
of the FAQ. Apparently it was not a common flame bait topic when the
FAQ was written. Maybe I should update that part, but then, who reads
the FAQ these days?

- 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: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Not really locals

<875yvhtttk.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Fri, 03 Sep 2021 11:09:11 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <875yvhtttk.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="04c934b0ab82dea3a8fb8ff7e1f09cd6";
logging-data="32146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18EHJeizKY9xr8ge6mmnEnw"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:bW5/kp6truXIdZKcO1Lw6WQYsSE=
sha1:lNlMSUeRpvIpHSCG977c0EYTbJY=
 by: Paul Rubin - Fri, 3 Sep 2021 18:09 UTC

anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> I think the reason is that full-length names mainly cost RAM, which
> has become cheaper over time, while locals also (or mainly?) cost
> implementation effort and Forth system complexity, which does not
> become cheaper over time.

I dunno, the big Forths like Swift don't particularly skimp to avoid
complexity per se, but their devs seem to frown on locals even though
the implementation supports them.

The sentiment I see (I don't understand it so may be describing it
wrong) is more like: the Forth with its dual stack model is a wonderful
discovery, so anything that makes the dual stack model look less
wonderful must be heresy.

I'm not sure I even see the dual stack model as essential to Forth.
Maybe it would be fine to get rid of >r and r> if there are locals.

Here is another awful possible syntax:

5 >: FOO

would be like 5 TO FOO except FOO would be a local, instantiated by >:
if it hadn't already been in that word. The : in >: denotes that it is
(temporarily) defining a word. That is more in the spirit of scripting
languages that let you create variables without having to declare them.

Re: Not really locals

<sgv015$ckc$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Sat, 4 Sep 2021 15:25:57 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sgv015$ckc$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="12940"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sat, 4 Sep 2021 05:25 UTC

On 4/09/2021 04:09, Paul Rubin wrote:
>
> Maybe it would be fine to get rid of >r and r> if there are locals.

That's but one step short of asking why have stacks or Forth at all.
So let's ask it. What is your reason for wanting to know Forth - one
more language under the belt - or something else?

Re: Not really locals

<87wnnwswj7.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Fri, 03 Sep 2021 23:08:12 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <87wnnwswj7.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="9cb0d221448d0c8aa87bc4d220053f42";
logging-data="18759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tBeFvr8nGyIdEXtCEs2dz"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:NDI7Pcqav7imzE6GWmbZ45f7hYo=
sha1:Ex5ZRQ+c4wPUKwSoPxLJDY58hi0=
 by: Paul Rubin - Sat, 4 Sep 2021 06:08 UTC

dxforth <dxforth@gmail.com> writes:
> That's but one step short of asking why have stacks or Forth at all.

It's reasonable to separate those two questions I think. Can we have
stacks without Forth? Yes, PostScript etc. Can we have Forth without
stacks? That I suppose depends on your notion of what Forth is.

I think it is ok to want Forth while questioning stacks, even though I
don't have the answers.

> So let's ask it. What is your reason for wanting to know Forth - one
> more language under the belt - or something else?

I like the sense of KISS in Forth. I'm unconvinced that locals
seriously interfere with it. They make the user code simpler, which
seems KISS to me. I've written functions with locals that I don't see a
clean way to write without them.

Re: Not really locals

<sgve2a$1pkr$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Sat, 4 Sep 2021 19:25:30 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sgve2a$1pkr$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="59035"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sat, 4 Sep 2021 09:25 UTC

On 4/09/2021 16:08, Paul Rubin wrote:
> dxforth <dxforth@gmail.com> writes:
>> That's but one step short of asking why have stacks or Forth at all.
>
> It's reasonable to separate those two questions I think. Can we have
> stacks without Forth? Yes, PostScript etc. Can we have Forth without
> stacks? That I suppose depends on your notion of what Forth is.
>
> I think it is ok to want Forth while questioning stacks, even though I
> don't have the answers.
>
>> So let's ask it. What is your reason for wanting to know Forth - one
>> more language under the belt - or something else?
>
> I like the sense of KISS in Forth. I'm unconvinced that locals
> seriously interfere with it. They make the user code simpler, which
> seems KISS to me. I've written functions with locals that I don't see a
> clean way to write without them.
>

Then it's a different Forth and notion of KISS from Moore's who has
condemned locals. Far from bemoaning Forth's lack of locals, I find
it both interesting and challenging to find alternate ways of doing
things that make them redundant.

Re: Not really locals

<87sfyks1e3.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Sat, 04 Sep 2021 10:20:52 -0700
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <87sfyks1e3.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com> <sgve2a$1pkr$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="9cb0d221448d0c8aa87bc4d220053f42";
logging-data="5811"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sjPt1FbRWtsd9PFqyqnOA"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:QtGPo4O5xNSwd2TjOJKXgjI9SlY=
sha1:8R4UBIzvKOck8smX7OOcEMMDgPk=
 by: Paul Rubin - Sat, 4 Sep 2021 17:20 UTC

dxforth <dxforth@gmail.com> writes:
> Far from bemoaning Forth's lack of locals, I find it both interesting
> and challenging to find alternate ways of doing things that make them
> redundant.

But I thought the idea of a compiler was to simplify your coding task,
not make it more challenging. Doesn't designing a program present
enough high level challenges that we don't need the language's help in
making the low level parts challenging too?

I haven't understood Moore's objection to locals, but I gather he also
liked 3+length dictionary representation and maybe blocks.

I confess that I also find the idea of blocks pretty cool, maybe because
I've never actually used them.

Re: Not really locals

<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:ea16:: with SMTP id t22mr4921757qkj.507.1630793381680;
Sat, 04 Sep 2021 15:09:41 -0700 (PDT)
X-Received: by 2002:ad4:404e:: with SMTP id r14mr5590963qvp.13.1630793381357;
Sat, 04 Sep 2021 15:09:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.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 Sep 2021 15:09:41 -0700 (PDT)
In-Reply-To: <87wnnwswj7.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
Subject: Re: Not really locals
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sat, 04 Sep 2021 22:09:41 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Hans Bezemer - Sat, 4 Sep 2021 22:09 UTC

On Saturday, September 4, 2021 at 8:08:15 AM UTC+2, Paul Rubin wrote:
Yes, locals interfere with Forth. So far, I only used them in ports and example code. They slow things down by extending function call overhead.

And get it in your head: a stack is NOT array. For that reason I don't like pick and roll either. And yes, functions with lots of parameters are hard to implement - but that's it - work harder to get it right.

If you don't like Forth - that's alright. Go Lua or Python. Lots of alternatives. But don't bother people who do know how to write Forth with ridiculous 'proposals'.

Hans Bezemer

> dxforth <dxf...@gmail.com> writes:
> > That's but one step short of asking why have stacks or Forth at all.
> It's reasonable to separate those two questions I think. Can we have
> stacks without Forth? Yes, PostScript etc. Can we have Forth without
> stacks? That I suppose depends on your notion of what Forth is.
>
> I think it is ok to want Forth while questioning stacks, even though I
> don't have the answers.
> > So let's ask it. What is your reason for wanting to know Forth - one
> > more language under the belt - or something else?
> I like the sense of KISS in Forth. I'm unconvinced that locals
> seriously interfere with it. They make the user code simpler, which
> seems KISS to me. I've written functions with locals that I don't see a
> clean way to write without them.

Re: Not really locals

<1fc5cadd-914d-4ab3-bbaa-e95e8a9206a8n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:6253:: with SMTP id w80mr5049544qkb.237.1630795217276;
Sat, 04 Sep 2021 15:40:17 -0700 (PDT)
X-Received: by 2002:a05:620a:294d:: with SMTP id n13mr4823376qkp.179.1630795217114;
Sat, 04 Sep 2021 15:40:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.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 Sep 2021 15:40:16 -0700 (PDT)
In-Reply-To: <842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:579:8018:1b00:517d:7a41:98fe:e026;
posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 2001:579:8018:1b00:517d:7a41:98fe:e026
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com> <842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1fc5cadd-914d-4ab3-bbaa-e95e8a9206a8n@googlegroups.com>
Subject: Re: Not really locals
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sat, 04 Sep 2021 22:40:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 21
 by: Hugh Aguilar - Sat, 4 Sep 2021 22:40 UTC

On Saturday, September 4, 2021 at 3:09:42 PM UTC-7, the.bee...@gmail.com wrote:
> On Saturday, September 4, 2021 at 8:08:15 AM UTC+2, Paul Rubin wrote:
> Yes, locals interfere with Forth. So far, I only used them in ports and example code.
> They slow things down by extending function call overhead.
>
> And get it in your head: a stack is NOT array. For that reason I don't like pick and roll either.
> And yes, functions with lots of parameters are hard to implement - but that's it - work harder to get it right.

Work harder, not smarter!

> If you don't like Forth - that's alright. Go Lua or Python. Lots of alternatives.
> But don't bother people who do know how to write Forth with ridiculous 'proposals'.

My rquotations assume the use of locals in the parent function, and that the rquotation
will communicate information back to the parent function in these locals, despite
the fact that the HOF that the parent function called and which is executing the rquotation
has locals of its own.

Do my rquotations prove that I don't know how to write Forth?

I have yet to find anybody on comp.lang.forth who understands the concept of
general-purpose data-structures. Do you? Can you explain this concept?

Re: Not really locals

<sh1dt5$12tr$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Sun, 5 Sep 2021 13:35:02 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sh1dt5$12tr$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<1fc5cadd-914d-4ab3-bbaa-e95e8a9206a8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="35771"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 5 Sep 2021 03:35 UTC

On 5/09/2021 08:40, Hugh Aguilar wrote:
>
> I have yet to find anybody on comp.lang.forth who understands the concept of
> general-purpose data-structures. Do you? Can you explain this concept?

General-purpose data-structures implies lots of parameter passing which
necessitates locals. Did I get it right?

Re: Not really locals

<87o897sn3l.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Sat, 04 Sep 2021 20:44:14 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <87o897sn3l.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="874def15b8d851e465fa77882882be27";
logging-data="28176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NGqZe+fg0EFqfZ5e3XdcE"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:cQweO1Dn48jGufsZPucyHsZwq0I=
sha1:o6HLPLycKiXqfqlGHEFFjcSIwbI=
 by: Paul Rubin - Sun, 5 Sep 2021 03:44 UTC

Hans Bezemer <the.beez.speaks@gmail.com> writes:
> If you don't like Forth - that's alright. Go Lua or Python.

Processor is an ATTiny with maybe 1KB of available code memory and a few
hundred B of available ram. Forth seems about right for that.

In the early Forth era, ram and cpu cycles were both scarce, and
programs and data were both in ram (maybe loaded from blocks) so they
competed for space. Today, code is in flash so it doesn't exactly
compete with data, ram in small machines is maybe even more scarce than
before, flash tends to be less scarce than ram, and CPU cycles are
relatively plentiful (8 Mhz AVR is probably faster than most 1970s
minicomputers).

The drawback of locals that you mentioned (that they slow things down)
therefore now seems like a good trade, if they make the program smaller
and decrease ram use (program uses locals on R stack instead of more
VARIABLEs permanently occupying ram), at the cost of some CPU cycles.

Re: Not really locals

<sh1j5u$gdi$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Sun, 5 Sep 2021 15:05:04 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sh1j5u$gdi$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<87o897sn3l.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="16818"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 5 Sep 2021 05:05 UTC

On 5/09/2021 13:44, Paul Rubin wrote:
>
> The drawback of locals that you mentioned (that they slow things down)
> therefore now seems like a good trade, if they make the program smaller
> and decrease ram use (program uses locals on R stack instead of more
> VARIABLEs permanently occupying ram), at the cost of some CPU cycles.

But do they? Locals quickly chew up Rstack as one locals-based function
calls another. Even if temporary, locals are likely to use more memory
than corresponding stack operations. In an application whose source code
you have seen, I count:

153 colon definitions
19 constants
9 values
3 variables
0 locals

Of these, only two variables and one value might be considered 'temporary'.
If I used them, it's because they saved me bother and memory.

Re: Not really locals

<87k0jvscg0.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Sun, 05 Sep 2021 00:34:23 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <87k0jvscg0.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<87o897sn3l.fsf@nightsong.com> <sh1j5u$gdi$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="874def15b8d851e465fa77882882be27";
logging-data="26940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CvGgRz9y5YijBK+Wzos7m"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:Cqhyldlrp7aAGdCmuouU/bsBilI=
sha1:cKQjvRsXsl80HSQl3AMECpPmN5g=
 by: Paul Rubin - Sun, 5 Sep 2021 07:34 UTC

dxforth <dxforth@gmail.com> writes:
> In an application whose source code you have seen, I count: 153 colon
> definitions... only two variables and one value might be considered
> 'temporary'. If I used them, it's because they saved me bother and
> memory.

Hmm, which application is that? I guess that is fewer temp variables
than I would have expected. I think Chuck Moore's style was to use
variables rather freely, to avoid excessive stack juggling. Of course
it's sometimes possible to use the same variable for multiple purposes,
sort of like register allocation, but I figure that's asking for
trouble.

You may be onto something about R stack consumption. I was planning on
16 cells for each of D and R, but maybe I need more. I think it will be
ok though. Anyway, non-locals programs also save things in the R stack,
though maybe not as much.

Re: Not really locals

<af605773-5418-4d2b-bce1-a9c127cb2541n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:4c9c:: with SMTP id j28mr6104621qtv.224.1630828101366;
Sun, 05 Sep 2021 00:48:21 -0700 (PDT)
X-Received: by 2002:a05:622a:28d:: with SMTP id z13mr6031891qtw.313.1630828101152;
Sun, 05 Sep 2021 00:48:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 5 Sep 2021 00:48:21 -0700 (PDT)
In-Reply-To: <87wnnwswj7.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:254c:3919:57c5:6fa8;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:254c:3919:57c5:6fa8
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <af605773-5418-4d2b-bce1-a9c127cb2541n@googlegroups.com>
Subject: Re: Not really locals
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 05 Sep 2021 07:48:21 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Marcel Hendrix - Sun, 5 Sep 2021 07:48 UTC

On Saturday, September 4, 2021 at 8:08:15 AM UTC+2, Paul Rubin wrote:
> dxforth <dxf...@gmail.com> writes:
> > That's but one step short of asking why have stacks or Forth at all.
> It's reasonable to separate those two questions I think. Can we have
> stacks without Forth? Yes, PostScript etc. Can we have Forth without
> stacks? That I suppose depends on your notion of what Forth is.

The assertion is not correct. Could I turn Postscript into Forth (only
using Postscript)? No (because this is too vague). Could I add
stacks to a Forth without stacks? Of course, but here the problem
is to get that Forth to use these stack(s) where we expect a real Forth
to use them. In order to do that we need knowledge how that
'Forth' gets rid of the stack(s) in the first place. If it's mechanism
is " a @ b @ + c ! c@ " it should be relatively easy.

-marcel

Re: Not really locals

<697edce8-d809-409f-ba0c-7e384b2ef69en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:ea16:: with SMTP id t22mr6125998qkj.507.1630828618587;
Sun, 05 Sep 2021 00:56:58 -0700 (PDT)
X-Received: by 2002:a0c:e910:: with SMTP id a16mr6937303qvo.37.1630828618452;
Sun, 05 Sep 2021 00:56:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 5 Sep 2021 00:56:58 -0700 (PDT)
In-Reply-To: <87wnnwswj7.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:254c:3919:57c5:6fa8;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:254c:3919:57c5:6fa8
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <697edce8-d809-409f-ba0c-7e384b2ef69en@googlegroups.com>
Subject: Re: Not really locals
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 05 Sep 2021 07:56:58 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Marcel Hendrix - Sun, 5 Sep 2021 07:56 UTC

On Saturday, September 4, 2021 at 8:08:15 AM UTC+2, Paul Rubin wrote:
> dxforth <dxf...@gmail.com> writes:
> > That's but one step short of asking why have stacks or Forth at all.
> It's reasonable to separate those two questions I think. Can we have
> stacks without Forth? Yes, PostScript etc. Can we have Forth without
> stacks? That I suppose depends on your notion of what Forth is.

The assertion is not correct. Could I turn Postscript into Forth (only
using Postscript)? No (because this is too vague). Could I add
stacks to a Forth without stacks? Of course, but here the problem
is to get that Forth to use these stack(s) where we expect a real Forth
to use them. In order to do that we need knowledge how that
'Forth' gets rid of the stack(s) in the first place. If its mechanism
is "a @ b @ + c ! c@" it should be relatively easy.

-marcel

Re: Not really locals

<sh22l2$1qfk$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Sun, 5 Sep 2021 19:29:08 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sh22l2$1qfk$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<87o897sn3l.fsf@nightsong.com> <sh1j5u$gdi$1@gioia.aioe.org>
<87k0jvscg0.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="59892"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sun, 5 Sep 2021 09:29 UTC

On 5/09/2021 17:34, Paul Rubin wrote:
> dxforth <dxforth@gmail.com> writes:
>> In an application whose source code you have seen, I count: 153 colon
>> definitions... only two variables and one value might be considered
>> 'temporary'. If I used them, it's because they saved me bother and
>> memory.
>
> Hmm, which application is that?

https://pastebin.com/Uv2EE4sn

> I guess that is fewer temp variables
> than I would have expected.

The three I picked as being 'local' are #DIGIT LEN MAXCHR. Others may
categorize them differently.

Re: Not really locals

<2021Sep5.151943@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Not really locals
Date: Sun, 05 Sep 2021 13:19:43 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 71
Message-ID: <2021Sep5.151943@mips.complang.tuwien.ac.at>
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
Injection-Info: reader02.eternal-september.org; posting-host="f2c0174bcd352ab0df34b8c070fdd3d3";
logging-data="21773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18E12utJ6OTwjXoh5XAMtJX"
Cancel-Lock: sha1:lk/F4U9cnDmtle/rDTXn5Fjo+QE=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Sep 2021 13:19 UTC

Paul Rubin <no.email@nospam.invalid> writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>> I think the reason is that full-length names mainly cost RAM, which
>> has become cheaper over time, while locals also (or mainly?) cost
>> implementation effort and Forth system complexity, which does not
>> become cheaper over time.
>
>I dunno, the big Forths like Swift don't particularly skimp to avoid
>complexity per se,

If you mean SwiftForth, that in particular seems to be designed more
than other big Forth systems for avoiding complexity.

>but their devs seem to frown on locals even though
>the implementation supports them.
>
>The sentiment I see (I don't understand it so may be describing it
>wrong) is more like: the Forth with its dual stack model is a wonderful
>discovery, so anything that makes the dual stack model look less
>wonderful must be heresy.

Yes, there could be something to that, too.

Speculation: They dug themselves into a position that locals are not
needed. Customer demand finally overran this position, but they are
still in its trenches.

>I'm not sure I even see the dual stack model as essential to Forth.
>Maybe it would be fine to get rid of >r and r> if there are locals.

The dual-stack model is essential. You cannot pass parameters and
return values on the data stack if the return address is on the data
stack. Well, ok, you could, but it would make Forth really cumbersome.

: 1+ swap 1 + swap ;

As for >R and R>, they certainly bring with themselves all the same
factoring restrictions as locals, so if locals are to be shunned
because of factoring, so should >R and R>. However, the data stack
alone is cumbersome if too many stack items are alive at the same
time, and >R and R> are an easily-implemented relief in that
situation.

Once you have locals and can define them anywhere in a definition (as
you can in Gforth), I see no benefit in using >R and R>.

>Here is another awful possible syntax:
>
> 5 >: FOO
>
>would be like 5 TO FOO except FOO would be a local, instantiated by >:
>if it hadn't already been in that word.

In Gforth you can define a local anywhere, with code like

5 {: foo :}

There have been suggestions that this should work like 5 TO FOO if FOO
has been defined already, but I like the static-single-assignment
behaviour of {: FOO :} (when you see a local, you just have to look
for its definition to know what value it has; at least as long as
nobody uses TO with that local), so I have no plans to go there. You
get a redefinition warning and another local if you define a local
with the same name as an existing local.

- 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: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Not really locals

<d5f4cf90-0a6e-4c9e-bf44-67c434233a79n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:cd86:: with SMTP id v6mr8006307qvm.26.1630851745576;
Sun, 05 Sep 2021 07:22:25 -0700 (PDT)
X-Received: by 2002:ac8:489a:: with SMTP id i26mr7487213qtq.372.1630851745364;
Sun, 05 Sep 2021 07:22:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 5 Sep 2021 07:22:25 -0700 (PDT)
In-Reply-To: <2021Sep5.151943@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:46bc:2d96:1f66:b65d:5fa6;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:46bc:2d96:1f66:b65d:5fa6
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <2021Sep5.151943@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d5f4cf90-0a6e-4c9e-bf44-67c434233a79n@googlegroups.com>
Subject: Re: Not really locals
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 05 Sep 2021 14:22:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 68
 by: P Falth - Sun, 5 Sep 2021 14:22 UTC

On Sunday, 5 September 2021 at 16:02:32 UTC+2, Anton Ertl wrote:
> Paul Rubin <no.e...@nospam.invalid> writes:
> >an...@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> >> I think the reason is that full-length names mainly cost RAM, which
> >> has become cheaper over time, while locals also (or mainly?) cost
> >> implementation effort and Forth system complexity, which does not
> >> become cheaper over time.
> >
> >I dunno, the big Forths like Swift don't particularly skimp to avoid
> >complexity per se,
> If you mean SwiftForth, that in particular seems to be designed more
> than other big Forth systems for avoiding complexity.
> >but their devs seem to frown on locals even though
> >the implementation supports them.
> >
> >The sentiment I see (I don't understand it so may be describing it
> >wrong) is more like: the Forth with its dual stack model is a wonderful
> >discovery, so anything that makes the dual stack model look less
> >wonderful must be heresy.
> Yes, there could be something to that, too.
>
> Speculation: They dug themselves into a position that locals are not
> needed. Customer demand finally overran this position, but they are
> still in its trenches.
> >I'm not sure I even see the dual stack model as essential to Forth.
> >Maybe it would be fine to get rid of >r and r> if there are locals.
> The dual-stack model is essential. You cannot pass parameters and
> return values on the data stack if the return address is on the data
> stack. Well, ok, you could, but it would make Forth really cumbersome.
>
> : 1+ swap 1 + swap ;
>
> As for >R and R>, they certainly bring with themselves all the same
> factoring restrictions as locals, so if locals are to be shunned
> because of factoring, so should >R and R>. However, the data stack
> alone is cumbersome if too many stack items are alive at the same
> time, and >R and R> are an easily-implemented relief in that
> situation.
>
> Once you have locals and can define them anywhere in a definition (as
> you can in Gforth), I see no benefit in using >R and R>.
> >Here is another awful possible syntax:
> >
> > 5 >: FOO
> >
> >would be like 5 TO FOO except FOO would be a local, instantiated by >:
> >if it hadn't already been in that word.
> In Gforth you can define a local anywhere, with code like
>
> 5 {: foo :}
>
> There have been suggestions that this should work like 5 TO FOO if FOO
> has been defined already, but I like the static-single-assignment
> behaviour of {: FOO :} (when you see a local, you just have to look
> for its definition to know what value it has; at least as long as
> nobody uses TO with that local), so I have no plans to go there. You
> get a redefinition warning and another local if you define a local
> with the same name as an existing local.

How does it work at runtime when the definition is inside a loop?

Peter

> - 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: http://www.forth200x.org/forth200x.html
> EuroForth 2021: https://euro.theforth.net/2021

Re: Not really locals

<2021Sep5.175531@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Not really locals
Date: Sun, 05 Sep 2021 15:55:31 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 86
Message-ID: <2021Sep5.175531@mips.complang.tuwien.ac.at>
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com> <2021Sep5.151943@mips.complang.tuwien.ac.at> <d5f4cf90-0a6e-4c9e-bf44-67c434233a79n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="f2c0174bcd352ab0df34b8c070fdd3d3";
logging-data="1301"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VXZOADZCnDHso+/db2BaO"
Cancel-Lock: sha1:ms1pcO62vQ2s2S78tuWJHwScPR8=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 5 Sep 2021 15:55 UTC

P Falth <peter.m.falth@gmail.com> writes:
>On Sunday, 5 September 2021 at 16:02:32 UTC+2, Anton Ertl wrote:
>> In Gforth you can define a local anywhere, with code like
>>
>> 5 {: foo :}
>>
>> There have been suggestions that this should work like 5 TO FOO if FOO
>> has been defined already, but I like the static-single-assignment
>> behaviour of {: FOO :} (when you see a local, you just have to look
>> for its definition to know what value it has; at least as long as
>> nobody uses TO with that local), so I have no plans to go there. You
>> get a redefinition warning and another local if you define a local
>> with the same name as an existing local.
>
>How does it work at runtime when the definition is inside a loop?

Locals live in every place that can be reached by going through the
locals definition. This means that in

begin {: a :} while {: b :} repeat a . \ but b is is not visible

It also means that

do {: a :} loop a . \ this works

but

?do {: a :} loop \ a is not visible behind the loop

The compiler could reserve space for all the locals at the start of
the definition (and maybe update the reserved space by backpatching),
but in Gforth the locals definition pushes the locals it defines on
the locals stack; they are popped when they die.

: foo do i {: a :} loop a . ;

is compiled into

$7FD21C6BB030 (do)
$7FD21C6BB038 i
$7FD21C6BB040 >l
$7FD21C6BB048 (loop)-lp+!#
$7FD21C6BB050 <foo+$8>
$7FD21C6BB058 #8
$7FD21C6BB060 unloop
$7FD21C6BB068 @local0
$7FD21C6BB070 call
$7FD21C6BB078 <.>
$7FD21C6BB080 lp+
$7FD21C6BB088 ;s ok 4

The (loop)-lp+!# pops 8 bytes from the locals stack if the branch is
taken. For the fall-through case, the local is popped with the LP+
right before the ;S.

For more details, see:

@InProceedings{ertl94l,
author = "M. Anton Ertl",
title = "Automatic Scoping of Local Variables",
booktitle = "EuroForth~'94 Conference Proceedings",
year = "1994",
address = "Winchester, UK",
pages = "31--37",
url = "http://www.complang.tuwien.ac.at/papers/ertl94l.ps.gz",
abstract = "In the process of lifting the restrictions on using
locals in Forth, an interesting problem poses
itself: What does it mean if a local is defined in a
control structure? Where is the local visible? Since
the user can create every possible control structure
in ANS Forth, the answer is not as simple as it may
seem. Ideally, the local is visible at a place if
the control flow {\em must} pass through the
definition of the local to reach this place. This
paper discusses locals in general, the visibility
problem, its solution, the consequences and the
implementation as well as related programming style
questions."
}

- 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: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Not really locals

<87fsuiswxb.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Not really locals
Date: Sun, 05 Sep 2021 11:24:16 -0700
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <87fsuiswxb.fsf@nightsong.com>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com>
<2021Sep5.151943@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="874def15b8d851e465fa77882882be27";
logging-data="6527"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18b/U6xTIAlLvJUtvjsjfS4"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:nhwwQ9p2xVUoGFLcWQFHo/CQ/yU=
sha1:hVfZlA0cRkjP5AsPfVW5o5ltOOY=
 by: Paul Rubin - Sun, 5 Sep 2021 18:24 UTC

anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>Maybe it would be fine to get rid of >r and r> if there are locals.
>
> The dual-stack model is essential. You cannot pass parameters and
> return values on the data stack if the return address is on the data
> stack.

I mean there would still be a return stack, just no >r and r> .

> Once you have locals and can define them anywhere in a definition (as
> you can in Gforth), I see no benefit in using >R and R>.

Yes, same idea.

Re: Not really locals

<170af0dc-a586-4d84-99fe-b9d9cefd26den@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:166d:: with SMTP id d13mr8361861qko.491.1630885635174;
Sun, 05 Sep 2021 16:47:15 -0700 (PDT)
X-Received: by 2002:a0c:9d82:: with SMTP id s2mr9634678qvd.23.1630885635059;
Sun, 05 Sep 2021 16:47:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 5 Sep 2021 16:47:14 -0700 (PDT)
In-Reply-To: <sh1dt5$12tr$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:579:8018:1b00:5d5:5dd4:ba08:454d;
posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 2001:579:8018:1b00:5d5:5dd4:ba08:454d
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com> <842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<1fc5cadd-914d-4ab3-bbaa-e95e8a9206a8n@googlegroups.com> <sh1dt5$12tr$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <170af0dc-a586-4d84-99fe-b9d9cefd26den@googlegroups.com>
Subject: Re: Not really locals
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sun, 05 Sep 2021 23:47:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: Hugh Aguilar - Sun, 5 Sep 2021 23:47 UTC

On Saturday, September 4, 2021 at 8:35:03 PM UTC-7, dxforth wrote:
> On 5/09/2021 08:40, Hugh Aguilar wrote:
> >
> > I have yet to find anybody on comp.lang.forth who understands the concept of
> > general-purpose data-structures. Do you? Can you explain this concept?
> General-purpose data-structures implies lots of parameter passing which
> necessitates locals. Did I get it right?

No. You are not even close. You don't know what rquotations do,
and you don't know what a general-purpose data-structure is.

I haven't forgotten about how you mocked me by using the term "disambiguifier"
for some kindergarten-level code that you wrote.
You either don't know anything about that subject, or you were just acting stupid
for the purpose of annoying me.

Stop pestering me with idiotic nonsense --- I don't think that you know anything
about programming at all --- I don't want to hear anything further from you.

Re: Not really locals

<1e457975-3f31-4621-90ea-84532b02ff91n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1435:: with SMTP id k21mr8878114qkj.442.1630886819592;
Sun, 05 Sep 2021 17:06:59 -0700 (PDT)
X-Received: by 2002:ac8:1498:: with SMTP id l24mr8607874qtj.169.1630886819472;
Sun, 05 Sep 2021 17:06:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 5 Sep 2021 17:06:59 -0700 (PDT)
In-Reply-To: <87k0jvscg0.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:579:8018:1b00:5d5:5dd4:ba08:454d;
posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 2001:579:8018:1b00:5d5:5dd4:ba08:454d
References: <87mtp3ux27.fsf@nightsong.com> <2021Aug27.121151@mips.complang.tuwien.ac.at>
<sgf5k8$1h36$1@gioia.aioe.org> <612bdf5d$0$696$14726298@news.sunsite.dk>
<87eea6tyl4.fsf@nightsong.com> <2021Sep3.120548@mips.complang.tuwien.ac.at>
<875yvhtttk.fsf@nightsong.com> <sgv015$ckc$1@gioia.aioe.org>
<87wnnwswj7.fsf@nightsong.com> <842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<87o897sn3l.fsf@nightsong.com> <sh1j5u$gdi$1@gioia.aioe.org> <87k0jvscg0.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e457975-3f31-4621-90ea-84532b02ff91n@googlegroups.com>
Subject: Re: Not really locals
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Mon, 06 Sep 2021 00:06:59 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 33
 by: Hugh Aguilar - Mon, 6 Sep 2021 00:06 UTC

On Sunday, September 5, 2021 at 12:34:25 AM UTC-7, Paul Rubin wrote:
> I think Chuck Moore's style was to use
> variables rather freely, to avoid excessive stack juggling. Of course
> it's sometimes possible to use the same variable for multiple purposes,
> sort of like register allocation, but I figure that's asking for
> trouble.

Using global variables is ignorant programming. I don't do that.

Walter Banks has a C compiler that reuses local variables. He says that
he can prove that this takes the same memory as a local-stack would.
This is not difficult to implement. You have to compile an entire program
at once, and you keep track of which functions call which other functions,
and you make sure that a two functions in the same call-chain don't use
the same memory location for different local variables. A lot of compilers
do this. Turbo51 is an example, afaik. This is a good technique on a processor
such as the 8051 that has a direct addressing-mode but does not have an
indexed addressing-mode needed for a local-stack.

I was aware of this in 1994. When I hired on at Testra and was told that their
Dallas 80c320 motion-control program was too slow, I suggested that I write
a compiler for a Pascalish language that used this technique, so the direct
addressing-mode could be used rather than the Forth-style stack that is
grossly inefficient on the 8051. I was told that this wouldn't work because
most of the program had already been translated from Forth to assembly-language
and over 50% of the time was spent in ISRs, so the Forth stack was not
slowing the system down significantly. This could be done for Forth too,
using an analytic compiler, but it would kill interactive programming because
the entire program needs to be available for analysis, so not a good idea for Forth.

I wrote an assembler for the MSP430.
I could retarget this for the 8051 if there was a need for an 8051 program.
I would just stick with assembly-language on the 8051 though --- I wouldn't
use Forth --- on the MSP430 though, Forth should work well.

Re: Not really locals

<sh49sf$1ggs$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Mon, 6 Sep 2021 15:44:47 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sh49sf$1ggs$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<1fc5cadd-914d-4ab3-bbaa-e95e8a9206a8n@googlegroups.com>
<sh1dt5$12tr$1@gioia.aioe.org>
<170af0dc-a586-4d84-99fe-b9d9cefd26den@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="49692"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 6 Sep 2021 05:44 UTC

On 6/09/2021 09:47, Hugh Aguilar wrote:
> On Saturday, September 4, 2021 at 8:35:03 PM UTC-7, dxforth wrote:
>> On 5/09/2021 08:40, Hugh Aguilar wrote:
>> >
>> > I have yet to find anybody on comp.lang.forth who understands the concept of
>> > general-purpose data-structures. Do you? Can you explain this concept?
>> General-purpose data-structures implies lots of parameter passing which
>> necessitates locals. Did I get it right?
>
> No. You are not even close. You don't know what rquotations do,
> and you don't know what a general-purpose data-structure is.
>
> I haven't forgotten about how you mocked me by using the term "disambiguifier"
> for some kindergarten-level code that you wrote.
> You either don't know anything about that subject, or you were just acting stupid
> for the purpose of annoying me.

Disambiguifiers were aimed at kindergarten-level users to convince them
how broken was ANS, and by implication those behind it. So it's been
for your general-purpose code routines - thinly-veiled expositions on
how ANS got it wrong. In the meantime they do the opposite. One has
to travel a long way in Forth to get past the pro/anti-ANS lobby.

>
> Stop pestering me with idiotic nonsense --- I don't think that you know anything
> about programming at all --- I don't want to hear anything further from you.
>

Re: Not really locals

<sh4osq$9sn$1@gioia.aioe.org>

  copy mid

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

  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: Not really locals
Date: Mon, 6 Sep 2021 20:00:59 +1000
Organization: Aioe.org NNTP Server
Message-ID: <sh4osq$9sn$1@gioia.aioe.org>
References: <87mtp3ux27.fsf@nightsong.com>
<2021Aug27.121151@mips.complang.tuwien.ac.at> <sgf5k8$1h36$1@gioia.aioe.org>
<612bdf5d$0$696$14726298@news.sunsite.dk> <87eea6tyl4.fsf@nightsong.com>
<2021Sep3.120548@mips.complang.tuwien.ac.at> <875yvhtttk.fsf@nightsong.com>
<sgv015$ckc$1@gioia.aioe.org> <87wnnwswj7.fsf@nightsong.com>
<842e2f23-e787-4aa6-a90c-8874891e1d9en@googlegroups.com>
<87o897sn3l.fsf@nightsong.com> <sh1j5u$gdi$1@gioia.aioe.org>
<87k0jvscg0.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="10135"; 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:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 6 Sep 2021 10:00 UTC

On 5/09/2021 17:34, Paul Rubin wrote:
>
> I was planning on
> 16 cells for each of D and R, but maybe I need more. I think it will be
> ok though. Anyway, non-locals programs also save things in the R stack,
> though maybe not as much.

So you're creating a forth? Care to share some details - target cpu,
language used to implement etc.

Regarding stack sizes, Forth-83 nominated a minimum of 64/48 bytes (for 16b
system). When trying out a simple multi-tasking example on DX-Forth which
printed numbers to the screen, I assigned 128/64. Too much less and the
Rstack overflowed.

\\ Demo 1
variable SCREEN screen off #user dup user CNT 1 cells +
( u) dup 128 64 tcb DCOUNTING \ task1 control block
( u) 128 64 tcb HCOUNTING \ task2 control block

: DCOUNTER ( -- ) dcounting activate decimal 0 cnt !
begin screen get 0 2 at-xy cnt @ dup 0 10 d.r
1+ cnt ! screen release pause again ;

: HCOUNTER ( -- ) hcounting activate hex 0 cnt !
begin screen get 15 2 at-xy cnt @ dup 0 10 d.r
1- cnt ! screen release pause again ;

: RUN ( -- ) /tasker page ." 2 tasks counting:"
dcounter hcounter multi begin key? until key drop single ;
cr ." Save demo1? " y/n [if] turnkey run DEMO1 bye [then]

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor