Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

It is easier to change the specification to fit the program than vice versa.


devel / comp.lang.forth / Requirements on the Forth standard

SubjectAuthor
* Requirements on the Forth standardAnton Ertl
+* Re: Requirements on the Forth standardMarcel Hendrix
|+* Re: Requirements on the Forth standardAnton Ertl
||`- Re: Requirements on the Forth standardMarcel Hendrix
|`* Re: Requirements on the Forth standardRuvim
| +- Re: Requirements on the Forth standardMarcel Hendrix
| `- Re: Requirements on the Forth standardMarcel Hendrix
+* Re: Requirements on the Forth standardKrishna Myneni
|`- Re: Requirements on the Forth standardAnton Ertl
+* Re: Requirements on the Forth standardRuvim
|+* Re: Requirements on the Forth standardJim Peterson
||+* Re: Requirements on the Forth standardnone
|||`* Re: Requirements on the Forth standardJim Peterson
||| +- Re: Requirements on the Forth standardPaul Rubin
||| +- Re: Requirements on the Forth standardDoug Hoffman
||| `- Re: Requirements on the Forth standardHugh Aguilar
||+- Re: Requirements on the Forth standardKrishna Myneni
||`- Re: Requirements on the Forth standardRuvim
|+* Re: Requirements on the Forth standardMarcel Hendrix
||`- Re: Requirements on the Forth standarddxforth
|`- Re: Requirements on the Forth standardRuvim
+* Re: Requirements on the Forth standardminf...@arcor.de
|+* Re: Requirements on the Forth standardKrishna Myneni
||`* Re: Requirements on the Forth standardnone
|| `* Re: Requirements on the Forth standardPaul Rubin
||  +* Re: Requirements on the Forth standardnone
||  |`* Re: Requirements on the Forth standardPaul Rubin
||  | `* Re: Requirements on the Forth standardnone
||  |  `- Re: Requirements on the Forth standardminf...@arcor.de
||  `* Re: Requirements on the Forth standardminf...@arcor.de
||   `- Re: Requirements on the Forth standardDoug Hoffman
|`* Re: Requirements on the Forth standardRuvim
| `* Re: Requirements on the Forth standardnone
|  `* Re: Requirements on the Forth standardRuvim
|   `* Re: Requirements on the Forth standardnone
|    `* Re: Requirements on the Forth standardRuvim
|     +* Re: Requirements on the Forth standardS Jack
|     |`- Re: Requirements on the Forth standardRuvim
|     `* Re: Requirements on the Forth standardGerry Jackson
|      `- Re: Requirements on the Forth standardRuvim
+* Re: Requirements on the Forth standardP Falth
|+- Re: Requirements on the Forth standardnone
|`* Re: Requirements on the Forth standardRuvim
| `- Re: Requirements on the Forth standardP Falth
+* Re: Requirements on the Forth standarddxforth
|`* Re: Requirements on the Forth standardRuvim
| `- Re: Requirements on the Forth standarddxforth
+- Re: Requirements on the Forth standardPaul Rubin
+* Re: Requirements on the Forth standardPaul Liles
|+* Re: Requirements on the Forth standarddxforth
||`* Re: Requirements on the Forth standardRuvim
|| `- Re: Requirements on the Forth standarddxforth
|`- Re: Requirements on the Forth standardRuvim
`- Re: Requirements on the Forth standardnone

Pages:123
Requirements on the Forth standard

<2021Jun9.105252@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Requirements on the Forth standard
Date: Wed, 09 Jun 2021 08:52:52 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 91
Message-ID: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Injection-Info: reader02.eternal-september.org; posting-host="3b5fea56377c63c5cdbe3dbc3fe79c41";
logging-data="29015"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EYs730gckFAYw/pQ5ObGD"
Cancel-Lock: sha1:7Chqmz0C5nbp5oFHUtptrNqbQIk=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 9 Jun 2021 08:52 UTC

In various discussions about the standard (what it means and how it
should be improved) we have used various requirements as justification
for the positions we take, but we actually have not discussed these
requirements much.

Many of the justifications are quite foggy in their actual meaning,
such as the appeal to simplicity (or denouncement of complexity). I
am not particularly interested in those, because they don't give any
real guidance. E.g., wrt simplicity, the simplest Forth system is one
that can do nothing; obviously there are cases where we consider other
things more important than simplicity, but the appeal to simplicity
does not give us any guidance when other things are more important.

But there are also hard requirements from which we can derive test
cases. I want to dicuss these and maybe find consensus on which of
these we want to pursue, or alternatively find out that there is no
consensus on some requirements.

Some requirements that come to my mind (in no particular order) are:

1) It must be possible to write a user-defined text interpreter in
standard Forth.

A.6.2.0945 COMPILE, suggests this. Maybe this can also be found
elsewhere in the standard. When we got rid of STATE-smartness in
Gforth in 1996, I used this requirement as guidance on what to do
about FIND (the specification in the document gives no guidance).
However, when testing whether FIND finds locals, three out of five
systems did not FIND locals, so the user-defined text interpreter does
not work for code with locals. Moreover, on VFX 5.11 some other case
fails, so the only system that does satisfy the requirement is Gforth.
And in comminicating with the maintainers of the other systems, they
apparently do not consider the user-defined text interpreter as a
requirement. And given that we do not hear about programs that break
on these systems, it's not a requirement that programs rely on, either.

So, can we just say that we don't want this requirement, or is there
something behind it that we want?

2) We must be able to copy code between interpreted and
compiled code.

This requirement is the reason for dual-semantics words like FILE S"
and TO, it is satisfied by the text interpreter for normal words and
numbers, and it seduces some people to implement STATE-smart immediate
words. OTOH, other people don't want STATE-smart words, which has led
to word pairs like ' and ['], CHAR and [CHAR]. Another option is to
implement dual-semantics words properly, but this practice is not
common enough to make it a requirement on systems.

In any case, we see this requirement at work as soon as we have a new
word with special compilation semantics, such as [:. Andrew Haley may
wish that this was not a requirement, but that does not make it go
away.

3) It must be able to define a word that is equivalent to any other
word (and maybe add some scaffolding, such as profiling or logging).

This is the requirement behind adding SYNONYM and the proposed
tightening of SYNONYM
<https://forth-standard.org/proposals/tighten-the-specification-of-synonym-version-1-#contribution-60>.
It is also a requirement mentioned by Ruvim as a justification for
some of his positions.

4) All words are equal. There is no fundamental difference between
system-defined and user-defined words. Words that deal with words
(e.g., ' FIND EXECUTE COMPILE,) work on all of them.

This was definitely the case in early Forth; you could even tick and
then EXECUTE and COMPILE, >R and EXIT. But cmForth broke with it: IF
is not always FINDable and not tickable, and there is no standard way
to add a word like S" to cmForth (while there is a system-specific
way). And in some modern systems ticking and then EXECUTEing >R and
EXIT does not work. And some positions say that this is ok, and say
that this has to take a back seat to requirement 3. Wil Baden held
the position that you must not tick words you did not define yourself.
And even in early Forth ['] IF EXECUTE is not equivalent to IF.

This list is not exhaustive. Please contribute additional hard
requirements.

The other direction in which this list can be extended is to go
deeper, e.g., to add test cases resulting from the requirements.

- 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: Requirements on the Forth standard

<38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:6084:: with SMTP id u126mr2038431qkb.294.1623280097314;
Wed, 09 Jun 2021 16:08:17 -0700 (PDT)
X-Received: by 2002:a05:620a:6d5:: with SMTP id 21mr2035693qky.325.1623280097155;
Wed, 09 Jun 2021 16:08:17 -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: Wed, 9 Jun 2021 16:08:16 -0700 (PDT)
In-Reply-To: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:542d:9ae7:22e4:26e1;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:542d:9ae7:22e4:26e1
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Wed, 09 Jun 2021 23:08:17 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marcel Hendrix - Wed, 9 Jun 2021 23:08 UTC

On Wednesday, June 9, 2021 at 1:41:00 PM UTC+2, Anton Ertl wrote:
[..]
> Some requirements that come to my mind (in no particular order) are:

OK, let's assume I lost the source to iForth and must rebuild from
scratch, what kind of Forth would I use for the reboot?

- Introspection:
Type 1: It should be possible to look at the source for any word (the
ultimate documentation).
Type 2: It should be possible for *words* to find out the
characteristics of any other word (documentation does
not count). I frequently want to know (in an application)
the xt and nt of a word (I use ' and head' for that).
Concrete questions are: is this system word a LOCAL, a variable,
a USER, a code definition, where is its data (relative to xt
or nt), how can I go from body to code and back, etc..

> 1) It must be possible to write a user-defined text interpreter in
> standard Forth.
[..]
Given introspection, I can always do that in a system-specific way,
which would suit me fine.

> 2) We must be able to copy code between interpreted and
> compiled code.
[..]
Not interesting. When the source of IF is available I'll copy that
instead.

> This requirement is the reason for dual-semantics words like FILE S"
> and TO, it is satisfied by the text interpreter for normal words and
> numbers, and it seduces some people to implement STATE-smart immediate
> words. OTOH, other people don't want STATE-smart words, which has led
> to word pairs like ' and ['], CHAR and [CHAR]. Another option is to
> implement dual-semantics words properly, but this practice is not
> common enough to make it a requirement on systems.
[..]
If all this goes away by admitting that there is a difference between
interpreted and compiled code that we must know about, that would be
a huge win.

> 3) It must be able to define a word that is equivalent to any other
> word (and maybe add some scaffolding, such as profiling or logging).
[..]
With the source, it is difficult to see where one would get stuck.

At this point it becomes clear that there may be a hidden requirement
in your list: that all these features are portable (i.e you can write
them *without* introspection and without *vendor support*.) I don't
care about portability.

> 4) All words are equal. There is no fundamental difference between
> system-defined and user-defined words. Words that deal with words
> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.

They should be equal in performance. If a mix of methods must be
used for some words, I'm fine with that.

> This was definitely the case in early Forth; you could even tick
> and then EXECUTE and COMPILE, >R and EXIT.
[..]
Definitely no desire to go back to that era if that is the only
reason.

-marcel

Re: Requirements on the Forth standard

<s9t31v$svb$1@dont-email.me>

  copy mid

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

  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: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Thu, 10 Jun 2021 08:11:26 -0500
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <s9t31v$svb$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Jun 2021 13:11:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ddd024922cf78924346e76e2cad28f47";
logging-data="29675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rPQF0sDL8V4t4fLLWF0JL"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:VlwlQEd2rDxRQk9Y1iti8X7oLRY=
In-Reply-To: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Krishna Myneni - Thu, 10 Jun 2021 13:11 UTC

On 6/9/21 3:52 AM, Anton Ertl wrote:
> In various discussions about the standard (what it means and how it
> should be improved) we have used various requirements as justification
> for the positions we take, but we actually have not discussed these
> requirements much.
>
> Many of the justifications are quite foggy in their actual meaning,
> such as the appeal to simplicity (or denouncement of complexity). I
> am not particularly interested in those, because they don't give any
> real guidance. E.g., wrt simplicity, the simplest Forth system is one
> that can do nothing; obviously there are cases where we consider other
> things more important than simplicity, but the appeal to simplicity
> does not give us any guidance when other things are more important.
>
> But there are also hard requirements from which we can derive test
> cases. I want to dicuss these and maybe find consensus on which of
> these we want to pursue, or alternatively find out that there is no
> consensus on some requirements.
>
> Some requirements that come to my mind (in no particular order) are:
>
'''
>
> 2) We must be able to copy code between interpreted and
> compiled code.
>

Where do you draw the line on this? When I designed kForth, I wanted to
be able to "converse" with the interpreter and enter statements like,

>file piecewise.dat -6e0 BEGIN fdup f. fdup f 2 spaces f. cr 1e-3 f+
fdup 6e0 f> until console

(here, f is a definition for a floating point function). I can in fact
execute the above statement from the interpreter, which saves me a lot
of time when I need to generate data to an output file. However, not
everything which can be compiled can be executed from the interpreter.

> This requirement is the reason for dual-semantics words like FILE S"
> and TO, it is satisfied by the text interpreter for normal words and
> numbers, and it seduces some people to implement STATE-smart immediate
> words. OTOH, other people don't want STATE-smart words, which has led
> to word pairs like ' and ['], CHAR and [CHAR]. Another option is to
> implement dual-semantics words properly, but this practice is not
> common enough to make it a requirement on systems.
>
> In any case, we see this requirement at work as soon as we have a new
> word with special compilation semantics, such as [:. Andrew Haley may
> wish that this was not a requirement, but that does not make it go
> away.

There's nothing special about "[:" in some implementations of Forth. It
can be defined in standard source in such systems. However, I like the
idea of dual-semantics words. Forth code for such systems can be written
to be more predictable in what words will do when used in different
ways, compared to single-xt + immediate flag systems.

>
> 3) It must be able to define a word that is equivalent to any other
> word (and maybe add some scaffolding, such as profiling or logging).
>
> This is the requirement behind adding SYNONYM and the proposed
> tightening of SYNONYM
> <https://forth-standard.org/proposals/tighten-the-specification-of-synonym-version-1-#contribution-60>.
> It is also a requirement mentioned by Ruvim as a justification for
> some of his positions.
>
> 4) All words are equal. There is no fundamental difference between
> system-defined and user-defined words. Words that deal with words
> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.
>

Ticking a word and being able to execute the xt, in a portable way, are
still two different things. I do care about portability. I don't believe
Forth source code should be tied to a single system. My published code
strives to be portable.

Krishna

Re: Requirements on the Forth standard

<s9t53u$bka$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Thu, 10 Jun 2021 16:46:36 +0300
Organization: A noiseless patient Spider
Lines: 126
Message-ID: <s9t53u$bka$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Jun 2021 13:46:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8495771b1ea0e7e842b1752bd57844d7";
logging-data="11914"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2HikQdk/eyC9QRhaH/4CX"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Zxutq1Xs9QEF0QA4EFk4lvSm5IQ=
In-Reply-To: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Thu, 10 Jun 2021 13:46 UTC

On 2021-06-09 11:52, Anton Ertl wrote:
> In various discussions about the standard (what it means and how it
> should be improved) we have used various requirements as justification
> for the positions we take, but we actually have not discussed these
> requirements much.
[...]

> Some requirements that come to my mind (in no particular order) are:
>
> 1) It must be possible to write a user-defined text interpreter in
> standard Forth.
[...]

Yes.

Concerning locals — my position is that a special word to handle locals
should be provided in the Locals word set. Perhaps, as a recognizer at once.

> 2) We must be able to copy code between interpreted and
> compiled code.

Yes, at least partially. Since we should not require interpretive
control-flow structures while they are not implemented in a portable way.

But we should move in this direction, I think.

> This requirement is the reason for dual-semantics words like FILE S"
> and TO, it is satisfied by the text interpreter for normal words and
> numbers, and it seduces some people to implement STATE-smart immediate
> words.

> OTOH, other people don't want STATE-smart words, which has led
> to word pairs like ' and ['], CHAR and [CHAR].

Do they really ready to use "S(", "[TO]", "[IS]", "[ACTION-OF]" ?
Why don't we see such a code?

> Another option is to
> implement dual-semantics words properly, but this practice is not
> common enough to make it a requirement on systems.

You know my position — dual semantics words can be properly implemented
as immediate STATE-dependent words, if "POSTPONE" is properly
implemented. But it's another discussion.

> In any case, we see this requirement at work as soon as we have a new
> word with special compilation semantics, such as [:. Andrew Haley may
> wish that this was not a requirement, but that does not make it go
> away.

Have you meant a new word with special interpretation semantics?

Since a word with undefined IS may be implemented as a single-semantics
word.

> 3) It must be able to define a word that is equivalent to any other
> word (and maybe add some scaffolding, such as profiling or logging).

Yes. But by this I would not mean that the old word and the new word
both can be used (in the source code level) by a program. In some cases
the old words after redefinition should not be available for a program.

> This is the requirement behind adding SYNONYM and the proposed
> tightening of SYNONYM
> <https://forth-standard.org/proposals/tighten-the-specification-of-synonym-version-1-#contribution-60>.
> It is also a requirement mentioned by Ruvim as a justification for
> some of his positions.

Wil Baden redefined dual semantics words [1] in the following way:

: TO STATE @ IF POSTPONE TO ELSE ['] TO EXECUTE THEN ; IMMEDIATE
: S" STATE @ IF POSTPONE S" ELSE ['] S" EXECUTE THEN ; IMMEDIATE

[1] ONLY STANDARD DEFINITIONS -- https://git.io/JZ4FL

It's a quite portable approach.

A more standard way would be to use "FIND" instead of "[']" and
"POSTPONE". But it seems, this way is less portable at the moment.

Yet another options is to provide the standard basic factors for all
dual-semantics words (or, better, that may be implemented as
dual-semantics words).

> 4) All words are equal. There is no fundamental difference between
> system-defined and user-defined words. Words that deal with words
> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.

In this regard, even the standard words are not equal to each other.

Usually, a user-defined word can be always ticked since the execution
semantics are always defined for it.

But via a Recognizer API, a user can define a "word" that can be handled
by the Forth text interpreter, but that cannot be ticked.

[...]

>
> This list is not exhaustive. Please contribute additional hard
> requirements.

>
> The other direction in which this list can be extended is to go
> deeper, e.g., to add test cases resulting from the requirements.

Yes, it should be the next stage.

--
Ruvim

Re: Requirements on the Forth standard

<b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:57d1:: with SMTP id w17mr5413198qta.149.1623335099429;
Thu, 10 Jun 2021 07:24:59 -0700 (PDT)
X-Received: by 2002:ad4:5fc7:: with SMTP id jq7mr5099830qvb.41.1623335099106;
Thu, 10 Jun 2021 07:24:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!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: Thu, 10 Jun 2021 07:24:58 -0700 (PDT)
In-Reply-To: <s9t53u$bka$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=184.170.72.255; posting-account=kidwfQoAAAAfI20wQGXIy9JZVTNSnVqm
NNTP-Posting-Host: 184.170.72.255
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t53u$bka$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: elkn...@gmail.com (Jim Peterson)
Injection-Date: Thu, 10 Jun 2021 14:24:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jim Peterson - Thu, 10 Jun 2021 14:24 UTC

Should the standard possibly promote standard libraries, much like C's "stdio.h" or C++'s <vector>, to be used with the "REQUIRED" keyword (perhaps involving a search path)? Forth users seem to consistently reinvent the wheel in terms of array types, linked-list searches, maybe even wordlist-style named elements (all of which are likely in use internally to a Forth system, but not exposed as tools for the user).

I feel like a robust collection of standard libraries (we could probably drum up the necessary source implementations, to be improved upon later) would do a lot towards promoting the use of Forth in standards-compliant systems. Since the standard could also provide the source code for such libraries, it doesn't seem like it would be too onerous for system developers except maybe on embedded systems with no disk access.

Of course, namespaces would be nice, or at least name prefixes, like "array..index", "list.find", etc. The default space is getting quite cluttered.

--Jim

Re: Requirements on the Forth standard

<2021Jun10.184730@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Requirements on the Forth standard
Date: Thu, 10 Jun 2021 16:47:30 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 163
Message-ID: <2021Jun10.184730@mips.complang.tuwien.ac.at>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="1dd0c19e7af2a9f27c564055120366dd";
logging-data="18693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qjTAOA1cS+2h0XWNVhlPu"
Cancel-Lock: sha1:xH1VI00ig594/nLwXQX8IrA+DaI=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 10 Jun 2021 16:47 UTC

Marcel Hendrix <mhx@iae.nl> writes:
>On Wednesday, June 9, 2021 at 1:41:00 PM UTC+2, Anton Ertl wrote:
>[..]
>> Some requirements that come to my mind (in no particular order) are:
>
>OK, let's assume I lost the source to iForth and must rebuild from
>scratch, what kind of Forth would I use for the reboot?
>
>- Introspection:
>Type 1: It should be possible to look at the source for any word (the
> ultimate documentation).

Yes, having LOCATE might be another requirement. Stephen Pelc has
argued for that, and Andrew Haley has even argued that recognized
things should be LOCATEable.

And yet nobody has proposed LOCATE for standardization.

>Type 2: It should be possible for *words* to find out the
> characteristics of any other word (documentation does
> not count). I frequently want to know (in an application)
> the xt and nt of a word (I use ' and head' for that).

FIND-NAME and NAME>INTERPRET have been standardized (FIND-NAME only in
the next standard).

> Concrete questions are: is this system word a LOCAL, a variable,
> a USER, a code definition, where is its data (relative to xt
> or nt), how can I go from body to code and back, etc..

I think that Forth has fallen back in introspection, an area where it
once was at the forefront. So yes, standardizing words for these
purposes is a good idea IMO. But you would also have to convince
others; it could be helpful if you can present use cases.

>> 1) It must be possible to write a user-defined text interpreter in
>> standard Forth.
>[..]
>Given introspection, I can always do that in a system-specific way,
>which would suit me fine.

You can always do that in a system-specific way, because it is done in
the system. But the issue is whether a standard program can do it,
and whether it can do it with FIND.

With newfangled stuff, we can do it as follows:

parse-name 2dup find-name dup if
nip nip state @ if name>compile else name>interpret then execute
else
... deal with numbers etc.
then

Or you can implement it with recognizers.

>> 2) We must be able to copy code between interpreted and
>> compiled code.
>[..]
>Not interesting. When the source of IF is available I'll copy that
>instead.

Maybe I did not make myself clear. When I have interpretively tested,
say

' fluffystunk catch

Let's say I want to copy and paste it into a colon definition

: foo
... some other code ...
' fluffystunk catch
... some other code ... ;

Oops, did not work.

Or I have an colon definition

: foo
create ...
[: ... ;] set-does>
[: ... ;] set-optimizer ;

I want to do it step-by-step:

create bar ...
\ works until now
[: ... ;] set-does>
.... \ test BAR
[: ... ;] set-optimizer
.... \ test compiled BAR

[: ... ;] must have the expected interpretation semntics for this to
work.

I don't know how the source code of IF would help in these examples.

>> This requirement is the reason for dual-semantics words like FILE S"
>> and TO, it is satisfied by the text interpreter for normal words and
>> numbers, and it seduces some people to implement STATE-smart immediate
>> words. OTOH, other people don't want STATE-smart words, which has led
>> to word pairs like ' and ['], CHAR and [CHAR]. Another option is to
>> implement dual-semantics words properly, but this practice is not
>> common enough to make it a requirement on systems.
>[..]
>If all this goes away by admitting that there is a difference between
>interpreted and compiled code that we must know about, that would be
>a huge win.

It's not about admitting. Users know there is a difference,
nevertheless they want to copy and paste between interpreted and
compiled code, and system implementors are more or less accomodating
to this wish (up to STATE-smart IF for interpretive uses of IF,
implemented AFAIK in Open Firmware).

So no, this does not go away by admitting that there is a difference.

>> 3) It must be able to define a word that is equivalent to any other
>> word (and maybe add some scaffolding, such as profiling or logging).
>[..]
>With the source, it is difficult to see where one would get stuck.

Even if you have the source, it is not always practical.

>At this point it becomes clear that there may be a hidden requirement
>in your list: that all these features are portable (i.e you can write
>them *without* introspection and without *vendor support*.) I don't
>care about portability.

It's about requirements on the Forth standard (hidden in the title of
my posting:-), so yes, saying that you can do it on every system in a
system-specific way does not count.

As for introspection: If we standardize words for that, then they can
be used in for satisfying the requirements.

>> 4) All words are equal. There is no fundamental difference between
>> system-defined and user-defined words. Words that deal with words
>> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.
>
>They should be equal in performance.

Performance guarantees have not been standardized, and I think they
are hard to standardize.

>> This was definitely the case in early Forth; you could even tick
>> and then EXECUTE and COMPILE, >R and EXIT.
>[..]
>Definitely no desire to go back to that era if that is the only
>reason.

Even so, one can work on satisfying this requirement. E.g., in iForth
Krishna Myneni's test

: test ['] I 10 0 do dup execute . loop drop cr ;

works.

- 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: Requirements on the Forth standard

<27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:424b:: with SMTP id l11mr3716306qvq.58.1623400772301;
Fri, 11 Jun 2021 01:39:32 -0700 (PDT)
X-Received: by 2002:a37:59c7:: with SMTP id n190mr2724871qkb.146.1623400772157;
Fri, 11 Jun 2021 01:39:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.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, 11 Jun 2021 01:39:31 -0700 (PDT)
In-Reply-To: <2021Jun9.105252@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f19:f2e0:2d4f:1915:8c4e:2782;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f19:f2e0:2d4f:1915:8c4e:2782
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Fri, 11 Jun 2021 08:39:32 +0000
Content-Type: text/plain; charset="UTF-8"
 by: minf...@arcor.de - Fri, 11 Jun 2021 08:39 UTC

Anton Ertl schrieb am Mittwoch, 9. Juni 2021 um 13:41:00 UTC+2:
> In various discussions about the standard (what it means and how it
> should be improved) we have used various requirements as justification
> for the positions we take, but we actually have not discussed these
> requirements much.
>
> Many of the justifications are quite foggy in their actual meaning,
> such as the appeal to simplicity (or denouncement of complexity). I
> am not particularly interested in those, because they don't give any
> real guidance. E.g., wrt simplicity, the simplest Forth system is one
> that can do nothing; obviously there are cases where we consider other
> things more important than simplicity, but the appeal to simplicity
> does not give us any guidance when other things are more important.
>
> But there are also hard requirements from which we can derive test
> cases. I want to dicuss these and maybe find consensus on which of
> these we want to pursue, or alternatively find out that there is no
> consensus on some requirements.
>
> Some requirements that come to my mind (in no particular order) are:

It is not clear whether you are referring to the standard, or want to renovate
Forth.

As to the first it is a hopeless case, because based on the current situation
there will be discussions over the implications of state-dependency and
different semantics even in twenty years. **gag**

As to the the second, start with getting rid of STATE and BASE and make
strings a first-class citizen.

Re: Requirements on the Forth standard

<s9vem3$45o$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 13:42:01 +0300
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <s9vem3$45o$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 11 Jun 2021 10:42:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="12995b52404fbd15afa483123e9a01f4";
logging-data="4280"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wyD0sZjdK4rHI4JlDBhPg"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:rOu/EZAd6QcfnVIeJjNHVeLOQJY=
In-Reply-To: <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Fri, 11 Jun 2021 10:42 UTC

On 2021-06-10 02:08, Marcel Hendrix wrote:
> On Wednesday, June 9, 2021 at 1:41:00 PM UTC+2, Anton Ertl wrote:
> [..]
>> Some requirements that come to my mind (in no particular order) are:

>
> - Introspection:
> Type 1: It should be possible to look at the source for any word (the
> ultimate documentation).

Some systems don't provide the source codes for all words. So, such a
requirement in the standard makes these systems non-standard.

> Type 2: It should be possible for *words* to find out the
> characteristics of any other word (documentation does
> not count). I frequently want to know (in an application)
> the xt and nt of a word (I use ' and head' for that).
> Concrete questions are: is this system word a LOCAL, a variable,
> a USER, a code definition, where is its data (relative to xt
> or nt), how can I go from body to code and back, etc..

What if variables, user-variables, constants, — are implemented as
ordinary words?

For example:

: lit, postpone literal ;
: ;, postpone ; ;

: constant ( x "name" -- ) >r : r> lit, ;, ;
: variable ( "name" -- ) align here 0 , constant ;

: zero-colon 0 ;
0 constant zero-constant

The words "zero-colon" and "zero-constant" are indistinguishable from
each other in regards of their kind in such a system.

OTOH, you can redefine some defining words to associate execution tokens
with the corresponding defining words (if any).

--
Ruvim

Re: Requirements on the Forth standard

<60c341ef$0$22695$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t53u$bka$1@dont-email.me> <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 11 Jun 2021 10:58:55 GMT
Lines: 49
Message-ID: <60c341ef$0$22695$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 6e9eb902.news.xs4all.nl
X-Trace: G=J41Ox4UR,C=U2FsdGVkX1/fUEWPwXRnSYtmZ24STprP4pyUjOcCi1MxUnoV3RKG5iCDEe/5v+RjR460Mp74S4qITvzN6S0GjfBewI+MkkB5XdXJEvGO0OcETK1sK1P/OCa2zRWhOaCI
X-Complaints-To: abuse@xs4all.nl
 by: none - Fri, 11 Jun 2021 10:58 UTC

In article <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>,
Jim Peterson <elkniwt@gmail.com> wrote:
>Should the standard possibly promote standard libraries, much like C's
>"stdio.h" or C++'s <vector>, to be used with the "REQUIRED" keyword
>(perhaps involving a search path)? Forth users seem to consistently
>reinvent the wheel in terms of array types, linked-list searches, maybe
>even wordlist-style named elements (all of which are likely in use
>internally to a Forth system, but not exposed as tools for the user).
>
>I feel like a robust collection of standard libraries (we could probably
>drum up the necessary source implementations, to be improved upon later)
>would do a lot towards promoting the use of Forth in standards-compliant
>systems. Since the standard could also provide the source code for such
>libraries, it doesn't seem like it would be too onerous for system
>developers except maybe on embedded systems with no disk access.
>
>Of course, namespaces would be nice, or at least name prefixes, like
>"array.index", "list.find", etc. The default space is getting quite
>cluttered.

Look at the floating point wordset in the standard.
There is no difference between a well defined wordset and a
library.

So all fat Forth systems like iforth swiftforth mpeforth gforth
would add every standardised wordset in their kernels,
as they do now with the fp wordset.
If anything that is what makes libraries so tricky, they are
hiding in plain sight. Hoever if all libraries are loaded all of the
time what is the use of libraries?

So my answer is:
yes we have standard libraries *already*
yes we have namespaces already; a wordlist defines an anonymous namespace.

(A named wordlist in ciforth is created by the word NAMESPACE.)

So Forth is powerful enough. Roll up your sleeves and get
programming already.

>
>--Jim

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: Requirements on the Forth standard

<2021Jun11.123702@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 10:37:02 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 49
Message-ID: <2021Jun11.123702@mips.complang.tuwien.ac.at>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t31v$svb$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="e5ac9c4e91714b299bcc869f64554e3a";
logging-data="7375"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Gfvfc5NqGm/xtPClm0LOn"
Cancel-Lock: sha1:Y5NCphXFIgrPN30uZS9a51Eej88=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Fri, 11 Jun 2021 10:37 UTC

Krishna Myneni <krishna.myneni@ccreweb.org> writes:
>On 6/9/21 3:52 AM, Anton Ertl wrote:
>> 2) We must be able to copy code between interpreted and
>> compiled code.
>>
>
>Where do you draw the line on this?

The question is where we all draw the line, and if we can find a
consensus on that. There are people like Andrew Haley who advocate
Forth without STATE and without user-definable recognizers, with word
pairs like ' ['] whenever necessary. And then there are people like
Mitch Bradley, which want to copy-and-paste code containing control
structures from compiled to interpreted code, and even finds the
pitfalls of STATE-smartness acceptable to achieve this.

Gforth goes relatively far with that, with return-stack words, [: and
DOES> obeying the copy-paste requirement (none of which we did because
of my personal preferences), but does not make control structures and
anything involving locals obey the copy-paste requirement.

I think that this principle is so important to many system
implementors and users that we should not pretend that we can ignore
it when making decisions in the standard. E.g. one advantage of
recognizers (both the old-fashioned integer and FP recognizers, and
the newfangled user-defined recognizers) is that they obey the
copy-paste requirement. Some people have advocated using parsing
words instead, which leads back to the ' ['] vs. dual-semantics
vs. STATE-smart discussions.

>> 4) All words are equal. There is no fundamental difference between
>> system-defined and user-defined words. Words that deal with words
>> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.
>>
>
>Ticking a word and being able to execute the xt, in a portable way, are
>still two different things.

Sure, and in the context of standardization, the result should also be
portable. Of course, for a number of words systems differ in what
they do when ticking and executing a word, but if we follow this
requirement, we should agree on a standard behaviour in that case.

- 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: Requirements on the Forth standard

<s9vij8$5fl$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 06:48:54 -0500
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <s9vij8$5fl$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Jun 2021 11:48:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="857d4e4a257b5da5458ed8293acaab7f";
logging-data="5621"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZzG2AQEWYYGgN84oEmWCR"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:5nNFaW9JeTEQAFUnnZaC3Vso3l8=
In-Reply-To: <27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
Content-Language: en-US
 by: Krishna Myneni - Fri, 11 Jun 2021 11:48 UTC

On 6/11/21 3:39 AM, minf...@arcor.de wrote:
> Anton Ertl schrieb am Mittwoch, 9. Juni 2021 um 13:41:00 UTC+2:
>> In various discussions about the standard (what it means and how it
>> should be improved) we have used various requirements as justification
>> for the positions we take, but we actually have not discussed these
>> requirements much.
>>
....
> As to the the second, start with getting rid of STATE and BASE and make
> strings a first-class citizen.
>

Getting rid of STATE won't be easy. I'm not sure why you want to get rid
of BASE. But standardized string operations is long overdue in Forth.

Krishna

Re: Requirements on the Forth standard

<s9vitv$9v1$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 06:54:37 -0500
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <s9vitv$9v1$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<s9t53u$bka$1@dont-email.me>
<b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Jun 2021 11:54:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="857d4e4a257b5da5458ed8293acaab7f";
logging-data="10209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PDkzbt+RgrYD01KGF4GJJ"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:loyeC4/I3/k7NFgsl+A7aWZTMqw=
In-Reply-To: <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
Content-Language: en-US
 by: Krishna Myneni - Fri, 11 Jun 2021 11:54 UTC

On 6/10/21 9:24 AM, Jim Peterson wrote:
....
> Of course, namespaces would be nice, or at least name prefixes, like "array.index", "list.find", etc. The default space is getting quite cluttered.
>

As Albert has mentioned, standard Forth has support for namespaces
through wordlists and search order control. A modular programming
framework which supports name reuse, built on top of standard Forth, is
described at the link below. We have used this framework successfully to
write and use Forth source libraries (widely used throughout the kForth
examples) for different applications.

Krishna

https://github.com/mynenik/kForth-64/blob/master/doc/modular-forth.pdf

Re: Requirements on the Forth standard

<60c35702$0$22712$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com> <s9vij8$5fl$1@dont-email.me>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 11 Jun 2021 12:28:50 GMT
Lines: 40
Message-ID: <60c35702$0$22712$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 2f0076c6.news.xs4all.nl
X-Trace: G=J41Ox4UR,C=U2FsdGVkX188oKvY/ANzmOrELGNLD7K0QhppqtV3HQlFDgbIchZgIWi58TUZLa70jHQQmuyWuo7EkRdTsJpEcEgBJaZESVC+MOaDl9feumctLaFLDeA1YDkROKTrpso9
X-Complaints-To: abuse@xs4all.nl
 by: none - Fri, 11 Jun 2021 12:28 UTC

In article <s9vij8$5fl$1@dont-email.me>,
Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
>On 6/11/21 3:39 AM, minf...@arcor.de wrote:
>> Anton Ertl schrieb am Mittwoch, 9. Juni 2021 um 13:41:00 UTC+2:
>>> In various discussions about the standard (what it means and how it
>>> should be improved) we have used various requirements as justification
>>> for the positions we take, but we actually have not discussed these
>>> requirements much.
>>>
>...
>> As to the the second, start with getting rid of STATE and BASE and make
>> strings a first-class citizen.
>>
>
>Getting rid of STATE won't be easy. I'm not sure why you want to get rid
>of BASE. But standardized string operations is long overdue in Forth.

I have demonstrated that getting rid of STATE is relatively easy.
INTERPRET in compilation mode just has to check whether an immediate word
has placed something on the stack. Then it runs LITERAL as needed.
This presupposes that literals are handled by the regular dictionary
lookup mechanism, i.e. recognizers.

The main problem with strings is that they may be transient.
One can solve that by always ALLOT ting them, but that may be
non-standard. Anyway, that is what I do, it solves more problems
than it creates. I'm pretty sure that ALLOCATE-ing them is okay.

Marcel Hendrix always uses # $ % instead of BASE. Having BASE in iforth
doesn't hurt for the occasional code he wants to import from elsewhere.
So I'm all for getting rid of unused words, BASE doesn't seem one
of them.

>
>Krishna
--
"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: Requirements on the Forth standard

<1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:7d7:: with SMTP id 206mr3711941qkh.3.1623417800618; Fri, 11 Jun 2021 06:23:20 -0700 (PDT)
X-Received: by 2002:a05:620a:91c:: with SMTP id v28mr3771978qkv.249.1623417800327; Fri, 11 Jun 2021 06:23:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.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: Fri, 11 Jun 2021 06:23:20 -0700 (PDT)
In-Reply-To: <60c341ef$0$22695$e4fe514c@news.xs4all.nl>
Injection-Info: google-groups.googlegroups.com; posting-host=184.170.72.255; posting-account=kidwfQoAAAAfI20wQGXIy9JZVTNSnVqm
NNTP-Posting-Host: 184.170.72.255
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t53u$bka$1@dont-email.me> <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com> <60c341ef$0$22695$e4fe514c@news.xs4all.nl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: elkn...@gmail.com (Jim Peterson)
Injection-Date: Fri, 11 Jun 2021 13:23:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 64
 by: Jim Peterson - Fri, 11 Jun 2021 13:23 UTC

On Friday, June 11, 2021 at 7:10:02 AM UTC-4, none albert wrote:
> In article <b91e9bd3-64ff-4dc0...@googlegroups.com>,
> Jim Peterson <elk...@gmail.com> wrote:
> >Should the standard possibly promote standard libraries, much like C's
> Look at the floating point wordset in the standard.
> There is no difference between a well defined wordset and a
> library.

Is this true? I don't see any way, in source code, to specify the loading and unloading of wordsets. I know that wordlists have that capability, and if the standard specified some wordlists the programmer could call upon for some utilities, that would definitely be a good start, but my main concern is running out of words to use. Many very generic words have already been used to specify rather specific functions. That's why I have to define "list.find" with a "list." prefix, and the trend to forego prefixes in the wordsets (except in the floating point wordset you mention, where the prefix seems to be one of "F", "SF", or "DF", for the most part) makes me worry about the clutter that would occur when what I'm proposing could maybe double or triple the number of words standardized.

> So my answer is:
> yes we have standard libraries *already*
> yes we have namespaces already; a wordlist defines an anonymous namespace..

Maybe we have the capability, but the standard isn't leveraging it to expand the utility of the language.

> So Forth is powerful enough. Roll up your sleeves and get
> programming already.

I've *been* programming. I have a vector library like C++'s <vector>. I have a qsort algorithm, some linked-list code, string "classes" and memory-based stacks... all things that others have already written and I could probably find a good version to use *somewhere*, but why?!? That's my point. Why should I have to write/google/download such things? Are they not something the standard would want to provide (as an option, for those concerned with code space), so that someone starting out in Forth could get actual work done rather than having to define words for arrays and array indexing? (ok, maybe that last one is simple enough that I'm overstating the issue... but still...)

Honestly, I worry that the major appeal of Forth is implementing such basic things and feeling proud of one's reinvention of the wheel... that it is not a language one comes to in order to get work done, but a playground from which to derive a false sense of accomplishment. If the standard were to provide many powerful libraries covering a majority of what was needed, would there be any appeal left in trying to remember the order of items on the data stack so as to get a program working compared to just moving on to something like Python or C++?

The one niche I've seen where Forth excels is from what seems to have been Chuck Moore's original impetus: once a base level of functionality exists on an otherwise new, unprogrammable system, the remainder of Forth can be implemented swiftly, bringing the system up to a level of usability that is not as easily achieved with other programming languages that have more complicated grammars. This may be a key aspect to leverage, possibly taking advatange of (and expanding upon) the forth-on-forth work I've seen in Ruvim's github repo. With embedded systems being all the rage for the past decade or more, being able to bring a new variant up to a level of usability quickly sounds like a job Forth is as suited for today as it was back in the era when it was invented.

--Jim

Re: Requirements on the Forth standard

<874ke46t1i.fsf@nightsong.com>

  copy mid

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

  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: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 13:32:57 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <874ke46t1i.fsf@nightsong.com>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<s9t53u$bka$1@dont-email.me>
<b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
<60c341ef$0$22695$e4fe514c@news.xs4all.nl>
<1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="318c66abeba39673ba606b44abfac087";
logging-data="18028"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CMmjCDSmm6oxm30hmtbPv"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:T0XmqVSAVHtetb29mzxxkF+xNRw=
sha1:BvPZfv36by2CgBLvLdtJxTB+zNM=
 by: Paul Rubin - Fri, 11 Jun 2021 20:32 UTC

Jim Peterson <elkniwt@gmail.com> writes:
> The one niche I've seen where Forth excels...: once a base level of
> functionality exists on an otherwise new, unprogrammable system, the
> remainder of Forth can be implemented swiftly, bringing the system up
> to a level of usability that is not as easily achieved with other
> programming languages that have more complicated grammars.

These days you'd bring up a new target using a cross compiler on a
separate computer, so the target system would only need a simple
debugging stub, e.g. something like Frank Sergeant's 3-instruction
Forth. The complexity of the application language wouldn't matter since
the host computer already has a working compiler. I'd also say that the
Forths used by professionals are way too complicated for the approach
you're describing.

Re: Requirements on the Forth standard

<60c3c884$0$708$14726298@news.sunsite.dk>

  copy mid

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

  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: Requirements on the Forth standard
Newsgroups: comp.lang.forth
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<s9t53u$bka$1@dont-email.me>
<b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
<60c341ef$0$22695$e4fe514c@news.xs4all.nl>
<1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
From: dhoffman...@gmail.com (Doug Hoffman)
Date: Fri, 11 Jun 2021 16:33:05 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.10.1
MIME-Version: 1.0
In-Reply-To: <1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: <60c3c884$0$708$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 23577de9.news.sunsite.dk
X-Trace: 1623443588 news.sunsite.dk 708 glidedog@gmail.com/68.55.82.126:62856
X-Complaints-To: staff@sunsite.dk
 by: Doug Hoffman - Fri, 11 Jun 2021 20:33 UTC

On 6/11/21 9:23 AM, Jim Peterson wrote:

> but my main concern is running out of words to use. Many very generic
> words have already been used to specify rather specific functions.

This is true.

> That's why I have to define "list.find" with a "list." prefix,

You don't *have* to. Most of my libraries: arrays, strings, etc. are
written as objects with polymorphism. Words like get, put, insert, and
so on can be used on any data type you want.

-Doug

Re: Requirements on the Forth standard

<87zgvw5dkm.fsf@nightsong.com>

  copy mid

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

  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: Requirements on the Forth standard
Date: Fri, 11 Jun 2021 13:52:25 -0700
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87zgvw5dkm.fsf@nightsong.com>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
<s9vij8$5fl$1@dont-email.me>
<60c35702$0$22712$e4fe514c@news.xs4all.nl>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="318c66abeba39673ba606b44abfac087";
logging-data="18028"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+s0Rd6oi7KgajEdFvgGCnf"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:BFdaQ/n/ZJoDw9Yd6jbA4SYQrz4=
sha1:4o0oG1Oyzp/BFmc6UC71J6HA5nQ=
 by: Paul Rubin - Fri, 11 Jun 2021 20:52 UTC

albert@cherry.(none) (albert) writes:
> The main problem with strings is that they may be transient.
> One can solve that by always ALLOT ting them, but that may be
> non-standard. Anyway, that is what I do, it solves more problems
> than it creates. I'm pretty sure that ALLOCATE-ing them is okay.

If strings are first-class, do you mean there is a separate string stack
like the FP stack? If you say DUP on the string stack (or the data
stack, if the string stack is not separate), does that allocate a new
copy of the string? If it's the data stack, how do you know that a
stack element is a string, so that you can allocate it?

If you use ALLOCATE, do you refcount the strings, or simply copy them
willy-nilly? What do you do about VARIABLEs with the addresses of
strings?

I think first-class strings is easiest if you have garbage collection.

Also, a separate string stack (like the separate FP stack) seems like a
weird antipattern caused by Forth's lack of a type system plus the
intricacy of accessing values inside a stack. So if you're trying to
re-imagine Forth from the ground up, that might be a better place to
start.

Re: Requirements on the Forth standard

<sa0l68$irt$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Sat, 12 Jun 2021 00:39:19 +0300
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <sa0l68$irt$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Jun 2021 21:39:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="12995b52404fbd15afa483123e9a01f4";
logging-data="19325"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/q6sXx3F6GDniI7cqGdIuk"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:2qUzzLR44KxlNyWiFqRlC5GR2Ys=
In-Reply-To: <27596cf2-2d26-4fbe-8e2b-306101873859n@googlegroups.com>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Fri, 11 Jun 2021 21:39 UTC

On 2021-06-11 11:39, minf...@arcor.de wrote:
>
> As to the the second, start with getting rid of STATE

Do you mean getting rid of dual-semantics words?

Since otherwise it doesn't make any sense.

If you can define a dual-semantics word via separate definitions for
interpretation and compilation semantics, then you can define
"IMMEDIATE" and a kind of "STATE". And vise versa: you can create a
mechanism to separately define interpretation and compilation semantics
for a dual-semantics word using "IMMEDIATE" and "STATE".

Let me know if you need a PoC.

--
Ruvim

Re: Requirements on the Forth standard

<sa0qnq$lgn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
Date: Sat, 12 Jun 2021 02:13:59 +0300
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <sa0qnq$lgn$1@dont-email.me>
References: <2021Jun9.105252@mips.complang.tuwien.ac.at>
<s9t53u$bka$1@dont-email.me>
<b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Jun 2021 23:14:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="847e8b980953baff25e60e4a5c489696";
logging-data="22039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hBLsQa+GNlrhstHLNC1Mj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:GJOmTgcdnVuUQVQ3JsMAkaxrqLo=
In-Reply-To: <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Fri, 11 Jun 2021 23:13 UTC

On 2021-06-10 17:24, Jim Peterson wrote:
> Should the standard possibly promote standard libraries, much like C's "stdio.h" or C++'s <vector>, to be used with the "REQUIRED" keyword (perhaps involving a search path)? Forth users seem to consistently reinvent the wheel in terms of array types, linked-list searches, maybe even wordlist-style named elements (all of which are likely in use internally to a Forth system, but not exposed as tools for the user).
>
> I feel like a robust collection of standard libraries (we could probably drum up the necessary source implementations, to be improved upon later) would do a lot towards promoting the use of Forth in standards-compliant systems. Since the standard could also provide the source code for such libraries, it doesn't seem like it would be too onerous for system developers except maybe on embedded systems with no disk access.

There are too many question, decisions, and work.

But have a look at some existent suites of libraries:

- Forth Scientific Library (FSL)
https://www.taygeta.com/fsl/sciforth.html

- Forth foundation library (FFL)
https://irdvo.nl/FFL/

- the Forth Net - Package manager and repository for Forth
https://theforth.net/packages

The standard should provide a minimal set of the basic factors to
support libraries managing.
One needed thing is the pathname of the file being currently loaded
(it's required to support relative paths)
Another needed thing is Recognizer API (it's required to support
qualified names and lexical blocks)

>
> Of course, namespaces would be nice, or at least name prefixes, like "array.index", "list.find", etc. The default space is getting quite cluttered.

I use names that are qualified by namespaces in the following form:

ns-a::ns-ab::ns-abc::wordname

Each namespace is represented by a word list.
Usually, I define a short alias (with limited scope).

E.g.
ns-a::ns-ab::ns-abc constant x
And then use
x::wordname

--
Ruvim

Re: Requirements on the Forth standard

<24faa77d-cb54-4afc-9755-b874fd8d3b0an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ae9:c219:: with SMTP id j25mr6824938qkg.235.1623465643190; Fri, 11 Jun 2021 19:40:43 -0700 (PDT)
X-Received: by 2002:a37:6c4:: with SMTP id 187mr7105202qkg.95.1623465643064; Fri, 11 Jun 2021 19:40:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.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: Fri, 11 Jun 2021 19:40:42 -0700 (PDT)
In-Reply-To: <1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=148.167.132.243; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 148.167.132.243
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t53u$bka$1@dont-email.me> <b91e9bd3-64ff-4dc0-a4b8-04f76eba5c52n@googlegroups.com> <60c341ef$0$22695$e4fe514c@news.xs4all.nl> <1f9f8e74-ac1c-471c-9c88-688b4d797e89n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <24faa77d-cb54-4afc-9755-b874fd8d3b0an@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sat, 12 Jun 2021 02:40:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 42
 by: Hugh Aguilar - Sat, 12 Jun 2021 02:40 UTC

On Friday, June 11, 2021 at 6:23:21 AM UTC-7, elk...@gmail.com wrote:
> On Friday, June 11, 2021 at 7:10:02 AM UTC-4, none albert wrote:
> > So Forth is powerful enough. Roll up your sleeves and get
> > programming already.

The Forth-200x committee are opposed to my rquotations. They hate general-purpose data-structures
because Elizabeth Rather hates general-purpose data-structures and they have to appease her.

The primary feature of the rquotations is to access the local variables in the parent function (the function
that called the HOF and where the rquotation was defined), despite the fact that the HOF has local variables
of its own. Typically the HOF will iterate through a data structure and execute the rquotation for every node.
The rquotation will communicate information back to the parent function via the parent function's locals.

> I've *been* programming. I have a vector library like C++'s <vector>. I have a qsort algorithm, some linked-list code,
> string "classes" and memory-based stacks... all things that others have already written and I could probably find
> a good version to use *somewhere*, but why?!? That's my point. Why should I have to write/google/download such things?
> Are they not something the standard would want to provide (as an option, for those concerned with code space),
> so that someone starting out in Forth could get actual work done rather than having to define words for arrays
> and array indexing? (ok, maybe that last one is simple enough that I'm overstating the issue... but still...)
>
> Honestly, I worry that the major appeal of Forth is implementing such basic things and feeling proud of one's reinvention
> of the wheel... that it is not a language one comes to in order to get work done, but a playground from which
> to derive a false sense of accomplishment. If the standard were to provide many powerful libraries covering
> a majority of what was needed, would there be any appeal left in trying to remember the order of items on the data stack
> so as to get a program working compared to just moving on to something like Python or C++?

Please truncate the lines in your post to less than 72 characters. You see all of those right-pointy chars above?
I typed them in myself.

Anyway --- please show us your linked-list code --- implementing a linked-list was attempted previously
by Peter Knaggs at EuroForth, but he failed badly. I doubt that there is anybody on the Forth-200x committee
who knows how to implement a linked list.

I agree with you that code libraries featuring general-purpose data-structures are needed to get any programming done.
This is why I wrote the novice-package. The Forth-200x committee absolutely hates this!

I don't think it is a good idea for the Forth-200x Standard to provide code-libraries as part of the Standard,
primarily because the Forth-200x committee members are idiots not capable of writing code that works.
Also, Elizabeth Rather absolutely hates the concept of code-libraries, and doesn't know what code-libraries are,
so the Forth-200x committee have to appease her in order to stay on the committee.

Re: Requirements on the Forth standard

<2bf21836-7e82-4585-a50e-2afba5f1feden@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:8d82:: with SMTP id p124mr7466396qkd.212.1623482262786;
Sat, 12 Jun 2021 00:17:42 -0700 (PDT)
X-Received: by 2002:ac8:5c48:: with SMTP id j8mr7292624qtj.154.1623482262578;
Sat, 12 Jun 2021 00:17:42 -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, 12 Jun 2021 00:17:42 -0700 (PDT)
In-Reply-To: <s9t53u$bka$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9t53u$bka$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2bf21836-7e82-4585-a50e-2afba5f1feden@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 12 Jun 2021 07:17:42 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marcel Hendrix - Sat, 12 Jun 2021 07:17 UTC

On Thursday, June 10, 2021 at 3:46:40 PM UTC+2, Ruvim wrote:
> On 2021-06-09 11:52, Anton Ertl wrote:
> > In various discussions about the standard (what it means and how it
> > should be improved) we have used various requirements as justification
> > for the positions we take, but we actually have not discussed these
> > requirements much.
> [...]

> > OTOH, other people don't want STATE-smart words, which has led
> > to word pairs like ' and ['], CHAR and [CHAR].
> Do they really ready to use "S(", "[TO]", "[IS]", "[ACTION-OF]" ?
> Why don't we see such a code?

I have [IS] in iForth because I need it. It always causes problems when I
check out other people's code but I consider that a 'pedantic check' that
I don't mind having. I don't have [TO], but I realize now it is a good idea.
I need it a lot for my current iSPICE project (which hinges run-time code
generation). I think S( would be toooo pedantic for me, and [ACTION-OF]
is too long, I use IS? and [IS?] .

I suppose such useful practical tips should be pointed out more often.

-marcel

Re: Requirements on the Forth standard

<d41f4ce3-c235-4305-baed-60cd6ab6bb8en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:974:: with SMTP id do20mr8639585qvb.28.1623483186895;
Sat, 12 Jun 2021 00:33:06 -0700 (PDT)
X-Received: by 2002:ac8:a84:: with SMTP id d4mr7294186qti.109.1623483186744;
Sat, 12 Jun 2021 00:33:06 -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, 12 Jun 2021 00:33:06 -0700 (PDT)
In-Reply-To: <s9vem3$45o$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
<s9vem3$45o$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d41f4ce3-c235-4305-baed-60cd6ab6bb8en@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 12 Jun 2021 07:33:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Marcel Hendrix - Sat, 12 Jun 2021 07:33 UTC

On Friday, June 11, 2021 at 12:42:13 PM UTC+2, Ruvim wrote:
> On 2021-06-10 02:08, Marcel Hendrix wrote:
> > On Wednesday, June 9, 2021 at 1:41:00 PM UTC+2, Anton Ertl wrote:
> > [..]
> >> Some requirements that come to my mind (in no particular order) are:
>
> >
> > - Introspection:
> > Type 1: It should be possible to look at the source for any word (the
> > ultimate documentation).
> Some systems don't provide the source codes for all words. So, such a
> requirement in the standard makes these systems non-standard.

Then I won't use them.

> > Type 2: It should be possible for *words* to find out the
> > characteristics of any other word (documentation does
> > not count). I frequently want to know (in an application)
> > the xt and nt of a word (I use ' and head' for that).
> > Concrete questions are: is this system word a LOCAL, a variable,
> > a USER, a code definition, where is its data (relative to xt
> > or nt), how can I go from body to code and back, etc..
> What if variables, user-variables, constants, — are implemented as
> ordinary words?

No problem, they will/should report as a colon-definition or code.
In that case I will simply redefine them so that I actually can modify
their storage locations (that is what I normally need).
It is a bit of a nuisance but it will even work for a USER variable:
: BASE! ( +n -- ) BASE ! ;
: BASE@ ( -- +n ) BASE @ ; etc.

It will NOT work for a LOCAL which might force using globals.
: aLocal! ( u -- ) S" TO aLocal!" EVALUATE ; IMMEDIATE COMPILE-ONLY

> : zero-colon 0 ;
> 0 constant zero-constant
>
> The words "zero-colon" and "zero-constant" are indistinguishable from
> each other in regards of their kind in such a system.

Yes, therefore I'd require words like CONSTANT? taking a nt or xt.
> OTOH, you can redefine some defining words to associate execution tokens
> with the corresponding defining words (if any).

Indeed, that is exactly what I do in iForth's introspection library :-)

-marcel

Re: Requirements on the Forth standard

<1e2fe379-ec62-45a8-b614-d1efdd6d2a9en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5e46:: with SMTP id i6mr7324485qtx.366.1623483479835;
Sat, 12 Jun 2021 00:37:59 -0700 (PDT)
X-Received: by 2002:a37:9a43:: with SMTP id c64mr7516254qke.109.1623483479700;
Sat, 12 Jun 2021 00:37:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.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, 12 Jun 2021 00:37:59 -0700 (PDT)
In-Reply-To: <s9vem3$45o$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com>
<s9vem3$45o$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e2fe379-ec62-45a8-b614-d1efdd6d2a9en@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 12 Jun 2021 07:37:59 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marcel Hendrix - Sat, 12 Jun 2021 07:37 UTC

On Thursday, June 10, 2021 at 3:46:40 PM UTC+2, Ruvim wrote:
> On 2021-06-09 11:52, Anton Ertl wrote:
> > In various discussions about the standard (what it means and how it
> > should be improved) we have used various requirements as justification
> > for the positions we take, but we actually have not discussed these
> > requirements much.
> [...]

> > OTOH, other people don't want STATE-smart words, which has led
> > to word pairs like ' and ['], CHAR and [CHAR].
> Do they really ready to use "S(", "[TO]", "[IS]", "[ACTION-OF]" ?
> Why don't we see such a code?

I have [IS] in iForth because I need it. It always causes problems when I
check out other people's code but I consider that a 'pedantic check' that
I don't mind having. I don't have [TO], but I realize now it is a good idea.
I need it a lot for my current iSPICE project (which hinges on run-time code
generation). I think S( would be toooo pedantic for me, and [ACTION-OF]
is toooo long ( I use IS? and [IS?] ).

I suppose such useful practical tips should be pointed out more often.

-marcel

Re: Requirements on the Forth standard

<2fff449b-029f-4b41-9e6e-0aab488964b8n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:ba0c:: with SMTP id w12mr8861232qvf.41.1623490015315; Sat, 12 Jun 2021 02:26:55 -0700 (PDT)
X-Received: by 2002:a37:a710:: with SMTP id q16mr7753664qke.15.1623490015056; Sat, 12 Jun 2021 02:26:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.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, 12 Jun 2021 02:26:54 -0700 (PDT)
In-Reply-To: <2021Jun10.184730@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9; posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <38ac89f9-c462-49a2-84d7-87c281d98604n@googlegroups.com> <2021Jun10.184730@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2fff449b-029f-4b41-9e6e-0aab488964b8n@googlegroups.com>
Subject: Re: Requirements on the Forth standard
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 12 Jun 2021 09:26:55 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 128
 by: Marcel Hendrix - Sat, 12 Jun 2021 09:26 UTC

On Thursday, June 10, 2021 at 7:42:11 PM UTC+2, Anton Ertl wrote:
> Marcel Hendrix <m...@iae.nl> writes:
> >On Wednesday, June 9, 2021 at 1:41:00 PM UTC+2, Anton Ertl wrote:
[..]
> Yes, having LOCATE might be another requirement. Stephen Pelc has
> argued for that, and Andrew Haley has even argued that recognized
> things should be LOCATEable.

I use LOCATE all of the time for my own high-level projects, not only
for kernel words. I admit that having to use INSPECT (to jump into the
kernel source) for un-indexed words is a nuisance, but who wants WORDS
to list all the tiny system factors?

I don't know what I would do for recognizers, I honestly can't find a
convincing use case for them yet.

> And yet nobody has proposed LOCATE for standardization.
> >Type 2: It should be possible for *words* to find out the
> > characteristics of any other word (documentation does
> > not count). I frequently want to know (in an application)
> > the xt and nt of a word (I use ' and head' for that).
> FIND-NAME and NAME>INTERPRET have been standardized (FIND-NAME only in
> the next standard).
> > Concrete questions are: is this system word a LOCAL, a variable,
> > a USER, a code definition, where is its data (relative to xt
> > or nt), how can I go from body to code and back, etc..

They might not help with my listed objective.

> I think that Forth has fallen back in introspection, an area where it
> once was at the forefront. So yes, standardizing words for these
> purposes is a good idea IMO. But you would also have to convince
> others; it could be helpful if you can present use cases.

Apart from being the main reason I like Forth, I use introspection
for run-time code generation, which is a big thing for specialized
simulation and mathematical software (i.e. code dominated by
companies that keep the sources proprietary and feel no need
to advance the state of the art). Introspection is surprisingly
powerful in a simulation tool once one is past the novice stage.
However, I doubt my examples will convince a Forth user.

> >> 1) It must be possible to write a user-defined text interpreter in
> >> standard Forth.
> >[..]
> >Given introspection, I can always do that in a system-specific way,
> >which would suit me fine.
> You can always do that in a system-specific way, because it is done in
> the system. But the issue is whether a standard program can do it,
> and whether it can do it with FIND.
>
> With newfangled stuff, we can do it as follows:
[..]
It would be important if vendors were scheming to screw us, but the
current crop seems to be pretty reasonable. Planning for the next
Forth millenium would indeed make it less of a theoretical concern.

[..]
> >Not interesting. When the source of IF is available I'll copy that
> >instead.
> Maybe I did not make myself clear. When I have interpretively tested,
> say
>
> ' fluffystunk catch
[..]
> I don't know how the source code of IF would help in these examples.

No, but surely all the other source code would?

> >[..]
> >If all this goes away by admitting that there is a difference between
> >interpreted and compiled code that we must know about, that would be
> >a huge win.
> It's not about admitting. Users know there is a difference,
> nevertheless they want to copy and paste between interpreted and
> compiled code, and system implementors are more or less accomodating
> to this wish (up to STATE-smart IF for interpretive uses of IF,
> implemented AFAIK in Open Firmware).

"Want to" ? I can only speak for iForth, and we have not seen any request
for this in the past two decades.

> >[..]
> >With the source, it is difficult to see where one would get stuck.
> Even if you have the source, it is not always practical.

That is true. Maybe quality of implementation would help, but when
at the end of the list of suitable vendors, I might wish for a stronger
Standard.

> >At this point it becomes clear that there may be a hidden requirement
> >in your list: that all these features are portable (i.e you can write
> >them *without* introspection and without *vendor support*.) I don't
> >care about portability.
> It's about requirements on the Forth standard (hidden in the title of
> my posting:-), so yes, saying that you can do it on every system in a
> system-specific way does not count.

I didn't want to spoil my fun by reading that too carefully.
> >> 4) All words are equal. There is no fundamental difference between
> >> system-defined and user-defined words. Words that deal with words
> >> (e.g., ' FIND EXECUTE COMPILE,) work on all of them.
> >
> >They should be equal in performance.
> Performance guarantees have not been standardized, and I think they
> are hard to standardize.

Indeed, a slow system with my wishlist would let me recover
the lost iForth sources just fine.

> >> This was definitely the case in early Forth; you could even tick
> >> and then EXECUTE and COMPILE, >R and EXIT.
> >[..]
> >Definitely no desire to go back to that era if that is the only
> >reason.
> Even so, one can work on satisfying this requirement. E.g., in iForth
> Krishna Myneni's test
>
> : test ['] I 10 0 do dup execute . loop drop cr ;
>
> works.
> - anton

There is no guarantee that it works for everything a user could come
up with, and there is no guarantee that what works now will work in a
next release.

-marcel

Re: Requirements on the Forth standard

<60c4b55f$0$22687$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: Requirements on the Forth standard
References: <2021Jun9.105252@mips.complang.tuwien.ac.at> <s9vij8$5fl$1@dont-email.me> <60c35702$0$22712$e4fe514c@news.xs4all.nl> <87zgvw5dkm.fsf@nightsong.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 12 Jun 2021 13:23:43 GMT
Lines: 45
Message-ID: <60c4b55f$0$22687$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 58468f6b.news.xs4all.nl
X-Trace: G=Qdl6pIH0,C=U2FsdGVkX18YLFez9+zZBa/VB4zfzrAbljPazs9HHTLLySukZwKoRjpfCsQhKoEnJCSD3VUVLdZZxio9xuQyq3P8d0LIQcic4CHkvwkMRrQBEQ/e0dEw7HRX7l9ZCLUN
X-Complaints-To: abuse@xs4all.nl
 by: none - Sat, 12 Jun 2021 13:23 UTC

In article <87zgvw5dkm.fsf@nightsong.com>,
Paul Rubin <no.email@nospam.invalid> wrote:
>albert@cherry.(none) (albert) writes:
>> The main problem with strings is that they may be transient.
>> One can solve that by always ALLOT ting them, but that may be
>> non-standard. Anyway, that is what I do, it solves more problems
>> than it creates. I'm pretty sure that ALLOCATE-ing them is okay.
>
>If strings are first-class, do you mean there is a separate string stack
>like the FP stack? If you say DUP on the string stack (or the data
>stack, if the string stack is not separate), does that allocate a new
>copy of the string? If it's the data stack, how do you know that a
>stack element is a string, so that you can allocate it?
>
>If you use ALLOCATE, do you refcount the strings, or simply copy them
>willy-nilly? What do you do about VARIABLEs with the addresses of
>strings?
>
>I think first-class strings is easiest if you have garbage collection.
>
>Also, a separate string stack (like the separate FP stack) seems like a
>weird antipattern caused by Forth's lack of a type system plus the
>intricacy of accessing values inside a stack. So if you're trying to
>re-imagine Forth from the ground up, that might be a better place to
>start.

I have 8 Gbyte internal space. Default 1/5 is used for ALLOCATE.
The few strings that one types in oneself present a negligable memory leak.
Memory leaks are only a problem if they are a problem, not because
the Creator has an 53th commandment, communicated by self appointed
high priests.
So if I went for ALLOCATEd strings, that would not imply strings
stacks,garbage collection or worrying about pointers to those
permanent strings. If I say "AAP" and the string gets ALLOCATEd
that does say "first-class strings" as if we were talking about
lisp instead of Forth. It just says that you do not need to
worry that the string vanishes under a host of "system defined"
circumstances.

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


devel / comp.lang.forth / Requirements on the Forth standard

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor