• Re: single-xt approach in the standard

    From Stephen Pelc@21:1/5 to Ruvim on Sat Sep 21 14:47:22 2024
    On 17 Sep 2024 at 15:04:16 CEST, "Ruvim" <ruvim.pinka@gmail.com> wrote:

    There is a point of view (which I don't share) that it is impossible to implement the standard word `s"` (from the File word set) in a standard *program*. I.e., that the following definition for `s"` is not standard compliant:

    : s" ( "ccc" -- sd | )
    [char] " parse
    state @ if postpone sliteral exit then
    dup >r allocate throw tuck r@ move r>
    ; immediate

    This effectively means that the classic single-xt approach is impossible
    for a standard system.

    The problem with definitions such as yours above is that they attempt to
    solve the problem of words with "non-default compilation semantics"
    (NDCS) using both immediacy and state-smart techniques.

    There is nothing in the standard that says it has to be done that way.
    The trouble is that the standard provides no tools to implement such
    words. We (MPE) provide such tools in VFX Forth 64, which comes
    with full source code.

    If the standard removes the entitlement to have words such as S" a
    significant portion of implementors will just ignore the standard, so reducing its usefulness.

    I suspect that some members of the TC only talk to each other, and have
    little or no contact with people who disagree with them on fundamental
    issues.

    Stephen
    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)78 0390 3612, +34 649 662 974
    http://www.mpeforth.com
    MPE website
    http://www.vfxforth.com/downloads/VfxCommunity/
    downloads

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to dxf on Sun Sep 22 07:54:31 2024
    dxf <dxforth@gmail.com> writes:
    IMO small systems are better off with Forth-94.

    Small systems pick and choose from standards as they see fit; they
    ignore Forth-94 and Forth-2012 requirements in some places, but use
    the standard as a guideline in places where compliance is compatible
    with the requirements stemming from hardware limitations; in this
    way the standard is useful even for those systems and their users.

    The separate FP stack has not ever come up as an issue for small
    systems that I ever heard of, probably because these systems tend not
    to implement the optional Floating-Point wordset.

    One example of non-compliance is the way DOES> is implemented on many flash-based systems; in some systems it does not go with CREATE, but
    with <BUILDS, and the use of multiple DOES> on the same word is not
    supported.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to PMF on Sun Sep 22 07:23:33 2024
    peter.m.falth@gmail.com (PMF) writes:
    In my opinion the Forth standard should not care about implementation
    details like how a header is organized ( single, dual xt or some other
    way).

    It does not. SwiftForth could implement a standard-conforming FILE S"
    without changing the header structure.

    Looking back at the standard, in my opinion it was a mistake to
    standardize the nt! It would have been better to have
    FIND-INTERPRET instead of FIND-NAME NAME>INTERPRET and
    FIND-COMPILE instead of FIND-NAME NAME>COMPILE.

    And FIND-INTERPRET-IN and FIND-COMPILE-IN. What about
    TRAVERSE-WORDLIST? Would you then have TRAVERSE-WORDLIST-INTERPRET
    and TRAVERSE-WORDLIST-COMPILE? If so, how should MWORDS <http://theforth.net/package/mwords> behave?

    That would have given more freedom to organize the internal header
    structure.

    OTOH, the nt turns named words into a first-class concept that has its
    own handle, enabling words like TRAVERSE-WORDLIST and allowing
    programmers to write words like MWORDS.

    Very few system implementors use several headers per word (making the
    nt hard to implement), and none of these systems is widely used (have
    they been published at all)?

    And standardizing the nt has not taken away this freedom. The nt and
    all the words that deal with it are in TOOLS EXT and therefore optional.

    So you are not asking for freedom to organize the internal header
    structure in a standard system, but you are begrudging the programmers
    the freedom to write programs like MWORDS as a standard program
    requiring several words from the Programming-Tools Extensions word
    set.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to Anton Ertl on Sun Sep 22 12:05:53 2024
    In article <2024Sep22.095431@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxf <dxforth@gmail.com> writes:
    IMO small systems are better off with Forth-94.

    Small systems pick and choose from standards as they see fit; they
    ignore Forth-94 and Forth-2012 requirements in some places, but use
    the standard as a guideline in places where compliance is compatible
    with the requirements stemming from hardware limitations; in this
    way the standard is useful even for those systems and their users.

    There are other reasons to be elective. It is fine to have systems
    available where everything is present, like gforth.
    Small systems however have a place too, where only carefully selected
    words are implemented, leaving a system that is a compromise between
    being learnable and powerful. A library mechanism helps too.

    The separate FP stack has not ever come up as an issue for small
    systems that I ever heard of, probably because these systems tend not
    to implement the optional Floating-Point wordset.

    One example of non-compliance is the way DOES> is implemented on many >flash-based systems; in some systems it does not go with CREATE, but
    with <BUILDS, and the use of multiple DOES> on the same word is not >supported.

    This is not even a choice in flash based systems. The noforth
    model strives to use DOES> and has as little restrictions as
    possible. In a many programs the DOES> pointer is filled in once.
    If that pointer doesn't change it can be stored in flash.


    - anton
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Sun Sep 22 11:53:02 2024
    In article <vcbuog$3etuk$3@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2024-09-17 16:15, mhx wrote:
    On Tue, 17 Sep 2024 10:54:37 +0000, Ruvim wrote:

    Do you think that the Forth standard should recognize the classic
    single-xt approach as possible for implementing a standard Forth system? >>>
    The classic single-xt approach implies that only one execution token
    (xt) is associated with a name token (nt), and only one name token is
    associated with a word (a named Forth definition). And words whose
    compilation semantics differ form default compilation semantics are
    implemented as immediate words.

    First define exactly the [new things] that can be done with an xt or an
    nt.


    These things are well known.

    For "xt" — "compile,", "execute", "catch".

    For "nt" — "name>" (classic), "name>interpret", "name>compile", >"name>string".

    Also, "xt" and "nt" can be passed to the words that accept "x".



    But it is irrelevant to my questions.

    The single-xt approach was used in Forth systems long before Forth-94.
    Should this approach be possible for a standard system?

    There is a point of view (which I don't share) that it is impossible to >implement the standard word `s"` (from the File word set) in a standard >*program*. I.e., that the following definition for `s"` is not standard >compliant:

    : s" ( "ccc" -- sd | )
    [char] " parse
    state @ if postpone sliteral exit then
    dup >r allocate throw tuck r@ move r>
    ; immediate

    /*****************************************************************************/ /* This is not true. */ /*****************************************************************************/

    I have demonstrated that it is possible to make numbers state smart
    (the excursion to S" serves only to muddy the waters) where
    the definition of number or S" doesn't contain a reference to STATE.
    STATE can be handled purely in INTERPRET. If a word in compilation mode
    leaves something on the stack it is compiled as a literal.
    [This supposes that the data stack is not used as a compilation stack ].

    My approach to Forth is practical. Purisme like this serves no practical purpose. (I'm not in the : >= < 0= ; crowd. ) and I have no intent
    to implement it in my Forth (ciforth)
    In this context you could POSTPONE a number with the intended effect,
    without even thinking about it. (I'm opposed to POSTPONE, let alone
    postponing numbers, but anyway.)
    [ P.S. I am not as nervous as Anton Ertl about postponing state smart words.]


    This effectively means that the classic single-xt approach is impossible
    for a standard system.

    No!
    It just means that you are hung up on traditional implementation methods.

    What some of my customers tried is, by using standard words, associate
    generated code sequences with an xt (nearly impossible),

    or infer an nt from an xt (which is not 1-to-n [n>=3], and asymmetrical).

    Even in some classic single-xt systems, one xt can be associated with
    many nt. (of course, what is now "nt" was known as "NFA").

    I cringe on this formulation. Several words can have the same
    behaviour. These behaviours being the same is what counts.
    Talking about xt's in this way ignores the severe problems you
    get by ignoring whether or not a word (xt? nt? ) is a CREATE
    word or not.

    It all starts with the notion that you can separate the properties
    of a word, then ignore the word itself. You talk about an x-coordinate
    and ignore the point itself where it belongs too.

    A limited/qualified guarantee for the nt-xt relationship can be useful.
    Example: DEFER aa  ' DROP IS aa  allows to recover the nt "DROP" from
    aa's DEFER@ and it is possible to disassemble linked lists of nt's.

    You probably mean the *xt* "DROP" from aa's DEFER@

    DEFER aa
    ' DROP IS aa
    ' aa DEFER@ \ gives xt of DROP

    Of cause, a standard program cannot disassemble linked lists of nt's

    Someone should be the boss. I propose the dea ("nt") as the boss.
    You could get the xt (behaviour,"CFA") from the dea.
    You couldn't get the point back from it x-coordinate.
    --
    Ruvim


    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Pelc@21:1/5 to Ruvim on Sun Sep 22 12:09:42 2024
    On 21 Sep 2024 at 21:18:00 CEST, "Ruvim" <ruvim.pinka@gmail.com> wrote:

    The trouble is that the standard provides no tools to implement such
    words. We (MPE) provide such tools in VFX Forth 64, which comes
    with full source code.


    If the standard removes the entitlement to have words such as S" a
    significant portion of implementors will just ignore the standard, so reducing
    its usefulness.

    Agreed.

    The NDCS: notation in VFX provides a simplicity and clarity that is absent
    from most other approaches that I have seen.

    I suspect that some members of the TC only talk to each other, and have
    little or no contact with people who disagree with them on fundamental
    issues.

    What are the particular fundamental issues? And where can these people
    be heard?

    Mitch Bradley was particularly fervent in retaining state-smart words, especially when defining Domain Specific Languages (DSLs).
    He has a point, but the TC has been so fervent in its "state smart
    words are evil" approach that he simply regards Open Firmware
    as its own standard - another group lost to the current Forth
    standard.

    Does this matter? Yes, there are still OF projects at compaanies
    like Apple.

    It will be ineffective to assume that all this people will seek out
    the Forth standards committee. It is up to the committee to
    perform some research and talk sympathetically to people
    who have given up on Forth standards. It's just practical
    politics.
    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)78 0390 3612, +34 649 662 974
    http://www.mpeforth.com
    MPE website
    http://www.vfxforth.com/downloads/VfxCommunity/
    downloads

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Stephen Pelc on Sun Sep 22 14:28:43 2024
    Stephen Pelc <stephen@vfxforth.com> writes:
    On 21 Sep 2024 at 21:18:00 CEST, "Ruvim" <ruvim.pinka@gmail.com> wrote:
    What are the particular fundamental issues? And where can these people
    be heard?

    Mitch Bradley was particularly fervent in retaining state-smart words, >especially when defining Domain Specific Languages (DSLs).

    Everything I read from him on the topic was that he likes interpretive
    control structures, and that he has not experienced problems with
    state-smart implementations of such words. Fervent?

    He has a point, but the TC has been so fervent in its "state smart
    words are evil" approach that he simply regards Open Firmware
    as its own standard - another group lost to the current Forth
    standard.

    Mitch Bradley has been on the TC. It's interesting that you
    characterize the TC as being 'fervent in its "state smart words are
    evil" approach'; you were there, too. My impression used to be that
    while both camps existed and their influence is visible in various
    places in Forth-94, the intention was that at least words like S"
    should be implementable as STATE-smart words, and that the fact that
    the text of the standard does not reflect this intention is an
    oversight. Is my impression wrong?

    Does this matter? Yes, there are still OF projects at compaanies
    like Apple.

    Evidence? Certainly <https://apple.fandom.com/wiki/Open_Firmware> says:

    |Starting in 2006, Apple phased out its use of Open Firmware in favor
    |of EFI (Extensible Firmware Interface) during its transition to Intel |processors.

    So if Apple still uses Open Firmware, even Apple fans don't know about
    it.

    Oracle has canceled SPARC development in 2017, so that branch of Open
    Firmware is dying, too.

    So the only living branch of Open Firmware may be at IBM.

    It will be ineffective to assume that all this people will seek out
    the Forth standards committee. It is up to the committee to
    perform some research and talk sympathetically to people
    who have given up on Forth standards. It's just practical
    politics.

    Has anyone held you back from taking such efforts?

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Ruvim on Sun Sep 22 17:13:42 2024
    Ruvim <ruvim.pinka@gmail.com> writes:
    - All standard programs are single-xt programs (in the part of
    user-defined words). Why we should remove the way to document this >programs/words in the standard terms of interpretation semantics,
    compilation semantics and execution semantics?

    Who proposes removing that? I often write about the interpretatation
    and compilation semantics of various words with default compilation
    semantics or with immediate compilation semantics, and I see nobody
    who wants to remove that possibility.

    Examples:

    : foo 1 ;

    The execution semantics of FOO are to push 1 on the data stack.
    The interpretation semantics of FOO are to push 1 on the data stack.
    The compilation semantics of FOO are append the execution semantics of
    FOO to the current definition.

    : bar state @ ; immediate

    The execution semantics of BAR are to push the contents of STATE on
    the data stack.

    The interpretation semantics of BAR are to push the contents of STATE
    on the data stack.

    The compilation semantics of BAR are to push the contents of STATE on
    the data stack.

    With that we can then determine what code like

    : bla postpone bar ; immediate
    bla . \ prints 0
    ] bla [ . \ prints -1

    should do; I show the output in comments. I just tested gforth,
    iforth, SwiftForth, and VFX Forth, and unsurprisingly they all produce
    the output shown in the comments.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to stephen@vfxforth.com on Sun Sep 22 21:20:46 2024
    In article <vcp1e6$2700m$1@dont-email.me>,
    Stephen Pelc <stephen@vfxforth.com> wrote:
    Mitch Bradley was particularly fervent in retaining state-smart words, >especially when defining Domain Specific Languages (DSLs).
    He has a point, but the TC has been so fervent in its "state smart
    words are evil" approach that he simply regards Open Firmware
    as its own standard - another group lost to the current Forth
    standard.

    I don't object keeping STATE smart words out of the standards, however
    a standard committee has no business objecting to my using STATE smart
    words in program.
    I also have no scrupules using extensions in my own Forth
    that can not be reproduced portably.

    Does this matter? Yes, there are still OF projects at compaanies
    like Apple.
    Leaning extensibly on Open Source Forth is probably less
    disadvantageous than relying on c-libraries.


    It will be ineffective to assume that all this people will seek out
    the Forth standards committee. It is up to the committee to
    perform some research and talk sympathetically to people
    who have given up on Forth standards. It's just practical
    politics.

    --
    Stephen Pelc, stephen@vfxforth.com

    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Sun Sep 22 21:34:39 2024
    In article <vcpi98$25spg$1@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    <SNIP>

    2) Quote-delimited character interpretation ('A') makes programs
    simpler, this seems obvious.


    3) Two buffers for interpretive `s"` makes debugging simpler, because
    you can test words like `rename-file` interactively, see "A.17.3.4 Other >transient regions" in Forth-2012.

    I hate those two. Requiring an arbitrary number of buffers for s"
    (like 2). 'A' requires a special provision in number handling.
    I don't like overloading ' .

    Ruvim
    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Mon Sep 23 09:40:33 2024
    In article <vcpt4k$25spg$5@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2024-09-22 23:34, albert@spenarnc.xs4all.nl wrote:
    In article <vcpi98$25spg$1@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    <SNIP>

    2) Quote-delimited character interpretation ('A') makes programs
    simpler, this seems obvious.


    3) Two buffers for interpretive `s"` makes debugging simpler, because
    you can test words like `rename-file` interactively, see "A.17.3.4 Other >>> transient regions" in Forth-2012.

    I hate those two. Requiring an arbitrary number of buffers for s"
    (like 2). 'A' requires a special provision in number handling.
    I don't like overloading ' .

    You say this from the point of view of a system implementer. I don't see
    any objections on the merits.

    Those two make use of Forth simpler in programs. Do you have any counter >arguments?

    At first sight, no.

    An argument that doesn't cut it, that I think Forth is not well
    designed in the first place, and we are adding ornaments that make
    Forth like a Christmas tree.

    --
    Ruvim

    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to albert@spenarnc.xs4all.nl on Mon Sep 23 08:42:51 2024
    On Mon, 23 Sep 2024 7:40:33 +0000, albert@spenarnc.xs4all.nl wrote:
    An argument that doesn't cut it, that I think Forth is not well
    designed in the first place, and we are adding ornaments that make
    Forth like a Christmas tree.

    For this reason, I don't like major extensions to the
    standard. There would be a lot to ‘improve’ or add, but
    a standard is not a Forth system and not an application.

    A standard is just a paper that describes the minimum
    requirements for a minimum set of commands/words. The
    'users' of this standard can label their product as
    ANSI/ISO compliant.

    If the standard is tightened, there will be fewer
    compliant systems. That would be just another nail
    in the coffin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Mon Sep 23 10:36:10 2024
    In article <vcq1e5$25spg$7@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2024-09-22 13:53, albert@spenarnc.xs4all.nl wrote:
    In article <vcbuog$3etuk$3@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2024-09-17 16:15, mhx wrote:
    On Tue, 17 Sep 2024 10:54:37 +0000, Ruvim wrote:

    Do you think that the Forth standard should recognize the classic
    single-xt approach as possible for implementing a standard Forth system? >>>>>
    The classic single-xt approach implies that only one execution token >>>>> (xt) is associated with a name token (nt), and only one name token is >>>>> associated with a word (a named Forth definition). And words whose
    compilation semantics differ form default compilation semantics are
    implemented as immediate words.

    [...]

    The single-xt approach was used in Forth systems long before Forth-94.
    Should this approach be possible for a standard system?

    There is a point of view (which I don't share) that it is impossible to
    implement the standard word `s"` (from the File word set) in a standard
    *program*. I.e., that the following definition for `s"` is not standard
    compliant:
    The double negation makes it hard to understand.
    You are of the opinion that it is possible to implement s" in a standard program.
    You mean that the following code is standard compliant.
    You throw in the heap (ALLOCATE), that requires a powerful system, okay.
    If you require SLITERAL ALLOCATE TUCK (that are not present e.g. in the
    ciforth kernel) what is the probability that S" still has to be defined?
    (In ciforth it is already defined).

    : s" ( "ccc" -- sd | )
    [char] " parse
    state @ if postpone sliteral exit then
    dup >r allocate throw tuck r@ move r>
    ; immediate

    /*****************************************************************************/
    /* This is not true. */
    /*****************************************************************************/

    I have demonstrated that it is possible to make numbers state smart
    (the excursion to S" serves only to muddy the waters) where
    the definition of number or S" doesn't contain a reference to STATE.


    It seems, you have misunderstood what I said. I have said "in a standard >*program*", not "in a standard system".

    I misunderstood it. In fact the longer I look, the less I understand.
    Of course a number of standard words cannot be portably implemented.
    That is a remark I have made myself. In this case you say that in
    a Forth where an arbitrary set of difficult words are implemented
    it is possible to define S" portably in terms of standard words.
    So true.

    If I add the condition that STATE is only used in INTERPRET,
    that is cheating, and largely irrelevant.


    This is important for standard libraries that may need to define or
    redefine some standard words. Here by standard library I mean a standard >program that, when loaded, does not make the standard system non-standard.

    Agreed. However standard libraries are not useful in the context of
    gforth where every imaginable word in the standard is present,
    unless for the purpose of exactly defining meaning.
    I remember Algol68 went that route. Most features are explained
    in Algol68 itself, with the remark that the implementer should
    think of more clever ways to do it. Is this similar?


    See also "4.2.2 Other program documentation", that says:
    | A program shall also document:
    | - whether a Standard System exists after the program is loaded.


    What some of my customers tried is, by using standard words, associate >>>> generated code sequences with an xt (nearly impossible),

    or infer an nt from an xt (which is not 1-to-n [n>=3], and asymmetrical). >>>
    Even in some classic single-xt systems, one xt can be associated with
    many nt. (of course, what is now "nt" was known as "NFA").

    I cringe on this formulation.

    This is what the standard says. Namely, the section "3.1.3.5 Execution >tokens" says: "Different definitions may have the same execution token
    if the definitions are equivalent".

    For example:

    1 constant a
    1 constant b
    ' a ' b = .

    It is possible for a standard system to print "-1" when interpreting
    this program.

    I have a hard time with this. I can't argue with the standard however.
    "I cringe that this is in the standard."


    --
    Ruvim


    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to albert@spenarnc.xs4all.nl on Mon Sep 23 09:32:35 2024
    On Mon, 23 Sep 2024 8:36:10 +0000, albert@spenarnc.xs4all.nl wrote:

    In article <vcq1e5$25spg$7@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    [..]
    1 constant a
    1 constant b
    ' a ' b = .

    It is possible for a standard system to print "-1" when interpreting
    this program.

    I have a hard time with this. I can't argue with the standard however.
    "I cringe that this is in the standard."

    Why? 'a' and 'b' are user defined words, '=' is a standard word,
    and 'true' is the expected outcome.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to mhx on Mon Sep 23 13:57:43 2024
    In article <cbfd43c052e782daf7fd65e9464c1d30@www.novabbs.com>,
    mhx <mhx@iae.nl> wrote:
    On Mon, 23 Sep 2024 8:36:10 +0000, albert@spenarnc.xs4all.nl wrote:

    In article <vcq1e5$25spg$7@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    [..]
    1 constant a
    1 constant b
    ' a ' b = .

    It is possible for a standard system to print "-1" when interpreting
    this program.

    I have a hard time with this. I can't argue with the standard however.
    "I cringe that this is in the standard."

    Why? 'a' and 'b' are user defined words, '=' is a standard word,
    and 'true' is the expected outcome.

    I expect false is the expected outcome.


    -marcel
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Howe@21:1/5 to dxf on Mon Sep 23 10:45:01 2024
    On 2024-09-22 23:34, dxf wrote:
    The only guidance a standard can give is on duplicating the past. I see
    no value in creating a new forth simply to do that. As an individual one
    has the opportunity to bring something new that's not merely repetition.
    At the very least one can avoid repeating the same mistakes.

    A standard does provide guidance and knowledge of the past, but also provides a jump off point for new work, new designs, new blood.

    In the 1980's there were a plethora C compilers (tiny c, small c, sozobon c, bsd
    c, turbo c, watcom c, gnu c, sysv c, solaris, ...) just different enough to make
    portability of source code a PITA. Similarly all the *nix variants drove a need
    for POSIX and X/Open (now SUS) to improve portability of software (especially if
    they wanted government contracts).

    Linux came about and aimed for standards compliance in most aspects and then built new and/or improved tools that extend beyond the standards. Now clang has
    come on scene looking to dethrone the megalith gcc that is a bit of portability nightmare within itself as it tries to support numerous CPUs and OSes.

    Having an *agreed on* standard is a good thing, it helps new people learn what is portable, see/hear of pitfalls, and _then_ improve (speed, size, supported hardware) and extend. A standard should not get in the way of that, but help.

    I read a large number of these posts about the woes of building a standard and/or compliance - its like someone is trying to take away your favourite teddy, "Mr.Floop", or washing your favourite blanky once a year.

    I believe in standards and portability and there are those that sometimes need to break with them because of special niche targets, but at least they that do tend to know where they differ and document those differences.

    --
    Anthony C Howe
    achowe@snert.com BarricadeMX & Milters http://nanozen.snert.com/ http://software.snert.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Ruvim on Mon Sep 23 16:52:02 2024
    Ruvim <ruvim.pinka@gmail.com> writes:
    On 2024-09-23 12:36, albert@spenarnc.xs4all.nl wrote:
    I also wanted to say that there is an opinion that this definition does
    not implement `s"` specified in 11.6.1.2165. An interesting question for >those who share this opinion: how can 11.6.1.2165 be changed (if at all)
    to allow this implementation?

    The implementation is not in your posting, but I guess you mean a
    STATE-smart implementation. One way to allow a STATE-smart
    implementation of S" would be to state something like the following in
    the "Interpretation:" section of the glossary entry of 11.6.1.2165:

    An ambiguous condition exists if the interpretation semantics of S" is performed in other than interpration state.

    Likewise, add the following to the "Compilation:" section:

    An ambiguous condition exists if the compilation semantics of S" is
    performed in other than compilation state.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to mhx on Mon Sep 23 17:02:51 2024
    mhx@iae.nl (mhx) writes:
    On Mon, 23 Sep 2024 8:36:10 +0000, albert@spenarnc.xs4all.nl wrote:

    In article <vcq1e5$25spg$7@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    [..]
    1 constant a
    1 constant b
    ' a ' b = .
    ...
    Why? 'a' and 'b' are user defined words, '=' is a standard word,
    and 'true' is the expected outcome.

    Are you sure?

    [~:152648] iforth

    FORTH> 1 constant a ok
    FORTH> 1 constant b ok
    FORTH> ' a ' b = . 0 ok

    I actually know of no system that outputs -1.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Anton Ertl on Mon Sep 23 19:20:09 2024
    On Mon, 23 Sep 2024 17:02:51 +0000, Anton Ertl wrote:
    [..]
    [~:152648] iforth

    FORTH> 1 constant a ok
    FORTH> 1 constant b ok
    FORTH> ' a ' b = . 0 ok

    I actually know of no system that outputs -1.

    A really aggressive optimizer could :-)

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerry Jackson@21:1/5 to Anton Ertl on Tue Sep 24 09:10:14 2024
    On 23/09/2024 18:02, Anton Ertl wrote:
    mhx@iae.nl (mhx) writes:
    On Mon, 23 Sep 2024 8:36:10 +0000,albert@spenarnc.xs4all.nl wrote:

    In article<vcq1e5$25spg$7@dont-email.me>,
    Ruvim<ruvim.pinka@gmail.com> wrote:
    [..]
    1 constant a
    1 constant b
    ' a ' b = .
    ...
    Why? 'a' and 'b' are user defined words, '=' is a standard word,
    and 'true' is the expected outcome.
    Are you sure?

    [~:152648] iforth
    FORTH> 1 constant a ok
    FORTH> 1 constant b ok
    FORTH> ' a ' b = . 0 ok

    I actually know of no system that outputs -1.

    - anton

    I know it's different but:

    1 constant a
    synonym b a
    ' a ' b = . \ displayed -1 in 5 out of 6 Forths I just tried, including
    GForth.

    Comparing xt's is unsafe

    --
    Gerry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to do-not-use@swldwa.uk on Tue Sep 24 12:09:24 2024
    In article <vcts54$34hmb$1@dont-email.me>,
    Gerry Jackson <do-not-use@swldwa.uk> wrote:
    On 23/09/2024 18:02, Anton Ertl wrote:
    mhx@iae.nl (mhx) writes:
    On Mon, 23 Sep 2024 8:36:10 +0000,albert@spenarnc.xs4all.nl wrote:

    In article<vcq1e5$25spg$7@dont-email.me>,
    Ruvim<ruvim.pinka@gmail.com> wrote:
    [..]
    1 constant a
    1 constant b
    ' a ' b = .
    ...
    Why? 'a' and 'b' are user defined words, '=' is a standard word,
    and 'true' is the expected outcome.
    Are you sure?

    [~:152648] iforth
    FORTH> 1 constant a ok
    FORTH> 1 constant b ok
    FORTH> ' a ' b = . 0 ok

    I actually know of no system that outputs -1.

    - anton

    I know it's different but:

    1 constant a
    synonym b a
    ' a ' b = . \ displayed -1 in 5 out of 6 Forths I just tried, including >GForth.

    Comparing xt's is unsafe

    Look at this. An alias in ciforth is a word that has a different
    name and behaves exactly the same.

    1 CONSTANT B
    OK
    'B ALIAS A
    OK
    'B 'A = .
    0 OK
    'B >DFA 'A >DFA = \ Where the constants are stored.
    OK
    .
    0 OK \ False
    B A = .
    -1 \ True
    VARIABLE B
    OK
    'B ALIAS A
    OK
    12 B !
    OK
    A ?
    12 OK \ !!!!!

    P.S. 'B is the nt (a prefer dea) of B.
    A is the same variable than B, only with a different name.


    --
    Gerry

    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Howe@21:1/5 to Anton Ertl on Tue Sep 24 07:08:19 2024
    On 2024-09-17 15:25, Anton Ertl wrote:
    There is no standardized way to define words with arbitrary
    combinations of interpretation and compilation semantics. I don't
    consider this to be a problem. We would need such words only for
    defining words like S", and we don't need additional words of this
    kind.

    `STATE` smart words are essentially composite words of behaviour when compiled and when interpreted.

    a/ Outside of `INTERPRET` use of `NAME>COMPILE` and `NAME>INTERPRET`, what is the point of obtaining the `xt` of a interpreted word? Isn't `INTERPRET` pretty
    implementation specific having intimate knowledge of the internals?

    b/ If `STATE` smart words are problematic ( S" S\" ACTION-OF TO IS ), why not separate them into their composite parts which you can then obtain an `xt`? (I know there is a painful dislike of adding new words that never existed before).

    c/ Allow `STATE` smart words, but claim that trying to obtain the interpreting `xt` as non-portable behaviour (punt) and system/implementation specific. OR the corollary...

    c'/ Only allow obtaining the compile `xt` of `STATE` smart words as portable.


    --
    Anthony C Howe
    achowe@snert.com BarricadeMX & Milters http://nanozen.snert.com/ http://software.snert.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to All on Tue Sep 17 11:20:21 2024
    I would like to see an "officially recognized" standard reference
    system, speed and number of xt's per word are of no importance.

    Are you planning to make one?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Ruvim on Tue Sep 17 12:15:27 2024
    On Tue, 17 Sep 2024 10:54:37 +0000, Ruvim wrote:

    Do you think that the Forth standard should recognize the classic
    single-xt approach as possible for implementing a standard Forth system?

    The classic single-xt approach implies that only one execution token
    (xt) is associated with a name token (nt), and only one name token is associated with a word (a named Forth definition). And words whose compilation semantics differ form default compilation semantics are implemented as immediate words.

    First define exactly the [new things] that can be done with an xt or an
    nt.

    What some of my customers tried is, by using standard words, associate generated code sequences with an xt (nearly impossible), or infer an nt
    from an xt (which is not 1-to-n [n>=3], and asymmetrical).

    A limited/qualified guarantee for the nt-xt relationship can be useful. Example: DEFER aa ' DROP IS aa allows to recover the nt "DROP" from
    aa's DEFER@ and it is possible to disassemble linked lists of nt's.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@21:1/5 to All on Tue Sep 17 13:58:11 2024
    I hope that you are not trying to revive that dead old horse of state-smartness.

    There are already single-xt solutions to circumvent the poorly
    designed specifications of ' and POSTPONE e.g. use different
    wordlists for interpretation and compilation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Tue Sep 17 17:22:30 2024
    In article <vcc58d$3hmr0$2@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2024-09-17 17:58, minforth wrote:
    I hope that you are not trying to revive that dead old horse of
    state-smartness.

    Different people understand different things by "state-smartness".
    For some people the word "evaluate" is state smart, for other — not.

    So, it is unclear what do you mean.


    There are already single-xt solutions to circumvent the poorly
    designed specifications of ' and POSTPONE e.g. use different
    wordlists for interpretation and compilation.

    Do you mean https://github.com/uho/interpretive ?

    This solution implies that two nt are associated with some words (what >violates my initial point).

    This solution implies a single word list for all unordinary words. It is
    not suitable for programs that use many word lists.


    the poorly designed specifications of ' and POSTPONE

    POSTPONE is perfectly specified. What you dislike with it?


    Also numbers (denotations) are state smart, but EVALUATE is also
    a good point.



    --
    Ruvim
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to mhx on Tue Sep 17 17:18:25 2024
    In article <1a3ebf77c1ed8926d455a268e1309fe0@www.novabbs.com>,
    mhx <mhx@iae.nl> wrote:
    On Tue, 17 Sep 2024 10:54:37 +0000, Ruvim wrote:

    Do you think that the Forth standard should recognize the classic
    single-xt approach as possible for implementing a standard Forth system?

    The classic single-xt approach implies that only one execution token
    (xt) is associated with a name token (nt), and only one name token is
    associated with a word (a named Forth definition). And words whose
    compilation semantics differ form default compilation semantics are
    implemented as immediate words.

    First define exactly the [new things] that can be done with an xt or an
    nt.

    What some of my customers tried is, by using standard words, associate >generated code sequences with an xt (nearly impossible), or infer an nt
    from an xt (which is not 1-to-n [n>=3], and asymmetrical).

    A limited/qualified guarantee for the nt-xt relationship can be useful. >Example: DEFER aa ' DROP IS aa allows to recover the nt "DROP" from
    aa's DEFER@ and it is possible to disassemble linked lists of nt's.

    My take is that per definition xt is a behaviour, and no name associated.
    An empty nt (but this is a misnomer!) has no name, no behaviour, no data,
    an empty link field, and as far as other fields are present, they are empty too.
    In this situation one can fill in the behaviour into an nt, assign a
    name to it, or link it into a wordlist.
    If you have an xt, the only thing to do is run it, i.e. execute.
    There is no guarantee that there is name associated with it, that
    it is part of wordlist, and the data is only accessible if it
    is associated with a CREATEd word, which imply that it has a name.

    A word aliased in another wordlist can have the same behaviour
    exact same xt, not to speak from compile and interpret xt's.

    No wonder people get confused.


    -marcel
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Howe@21:1/5 to Ruvim on Tue Sep 17 15:12:08 2024
    On 2024-09-17 06:54, Ruvim wrote:
    Do you think that the Forth standard should recognize the classic single-xt approach as possible for implementing a standard Forth system?

    The classic single-xt approach implies that only one execution token (xt) is associated with a name token (nt), and only one name token is associated with a
    word (a named Forth definition). And words whose compilation semantics differ form default compilation semantics are implemented as immediate words.

    Given I prefer single-xt (currently), what I don't get is how for a dual-xt system you define a single word with two actions for interpret and compile. I don't see a word to distinguish between the two, except maybe IMMEDIATE.

    : s" ( "ccc" -- sd | )
    [char] " parse
    state @ if postpone sliteral exit then
    dup >r allocate throw tuck r@ move r>
    ; immediate

    Do you define the same word twice, once for compile (immediate) and again for interpret (order of definitions should not be important). Example:

    : s" ( "ccc" -- sd | ) postpone sliteral ; immediate
    : s" ( "ccc" -- sd | ) dup >r allocate throw tuck r@ move r> ;


    --
    Anthony C Howe
    achowe@snert.com BarricadeMX & Milters http://nanozen.snert.com/ http://software.snert.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anthony Howe@21:1/5 to Ruvim on Tue Sep 17 14:58:07 2024
    On 2024-09-17 07:59, Ruvim wrote:
    On 2024-09-17 15:20, minforth wrote:
    I would like to see an "officially recognized" standard reference
    system, speed and number of xt's per word are of no importance.

    Are you planning to make one?

    I think, having the single standard reference implementation is a big step back
    in Forth standardization process. Because implementation details of the particular implementation will be used as requirements.

    I think it should be recognised in some capacity, given Forth's origins, but whether there should be a reference implementation probably not.


    I think, the standard conformance test suite is enough.

    One would think so, but the test suite is:

    * incomplete
    * as published in draft 19-1 has typos and possible errors
    * test cases often test multiple words at once that have not be tested separately
    * assumes the entire draft with all the optional sets are present, rather than separate the word sets into separate unit tests

    For illustrative purposes, we can have several different implementations of Forth in Forth.

    If there is reference implementation(s) I think it would be interesting to have two: `single-xt` and `dual-xt` to demonstrate that both models worth and are conforming.

    --
    Anthony C Howe
    achowe@snert.com BarricadeMX & Milters http://nanozen.snert.com/ http://software.snert.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Anthony Howe on Tue Sep 17 19:25:39 2024
    Anthony Howe <achowe@snert.com> writes:
    On 2024-09-17 06:54, Ruvim wrote:
    Do you think that the Forth standard should recognize the classic single-xt >> approach as possible for implementing a standard Forth system?

    The classic single-xt approach implies that only one execution token (xt) is >> associated with a name token (nt), and only one name token is associated with a
    word (a named Forth definition). And words whose compilation semantics differ
    form default compilation semantics are implemented as immediate words.

    Given I prefer single-xt (currently), what I don't get is how for a dual-xt >system you define a single word with two actions for interpret and compile.

    If you want the interpretation and compilation semantics,
    NAME>INTERPRET gives you the interpretation semantics of the word, and NAME>COMPILE gives you the compilation semantics.

    I
    don't see a word to distinguish between the two, except maybe IMMEDIATE.

    There is no standardized way to define words with arbitrary
    combinations of interpretation and compilation semantics. I don't
    consider this to be a problem. We would need such words only for
    defining words like S", and we don't need additional words of this
    kind.

    If you want to see where going for full support for defining arbitrary combinations leads, read our EuroForth 2019 paper [paysan&ertl19].

    @InProceedings{paysan&ertl19,
    author = {Bernd Paysan and M. Anton Ertl},
    title = {The new {Gforth} Header},
    crossref = {euroforth19},
    pages = {5--20},
    url = {http://www.euroforth.org/ef19/papers/paysan.pdf},
    url-slides = {http://www.euroforth.org/ef19/papers/paysan-slides.pdf},
    video = {https://wiki.forth-ev.de/doku.php/events:ef2019:header},
    OPTnote = {refereed},
    abstract = {The new Gforth header is designed to directly
    implement the requirements of Forth-94 and
    Forth-2012. Every header is an object with a fixed
    set of fields (code, parameter, count, name, link)
    and methods (\texttt{execute}, \texttt{compile,},
    \texttt{(to)}, \texttt{defer@}, \texttt{does},
    \texttt{name>interpret}, \texttt{name>compile},
    \texttt{name>string}, \texttt{name>link}). The
    implementation of each method can be changed
    per-word (prototype-based object-oriented
    programming). We demonstrate how to use these
    features to implement optimization of constants,
    \texttt{fvalue}, \texttt{defer}, \texttt{immediate},
    \texttt{to} and other dual-semantics words, and
    \texttt{synonym}.}
    }

    @Proceedings{euroforth19,
    title = {35th EuroForth Conference},
    booktitle = {35th EuroForth Conference},
    year = {2019},
    key = {EuroForth'19},
    url = {http://www.euroforth.org/ef19/papers/proceedings.pdf}
    }

    : s" ( "ccc" -- sd | )
    [char] " parse
    state @ if postpone sliteral exit then
    dup >r allocate throw tuck r@ move r>
    ; immediate

    This definition does not implement the standard word CORE S" or FILE
    S" (maybe if he redefined NAME>INTERPRET and NAME>COMPILE, and
    consequently POSTPONE, and ', but he doesn't do that).

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Ruvim on Tue Sep 17 21:15:13 2024
    Ruvim <ruvim.pinka@gmail.com> writes:
    Do you think that the Forth standard should recognize the classic
    single-xt approach as possible for implementing a standard Forth system?

    I think that that's certainly intended at some point by the
    standardization committee, and I would support reasonable changes to
    the standard to make such systems standard-conforming. But I think
    it's up to the people who have implemented such a system (in
    particular, Forth, Inc.) to propose something reasonable in this
    direction. They have not done so (and there has been ample
    opportunity), so they seem to be happy with the current state of
    affairs: SwiftForth does not comply with the standard for S" and a
    number of other words, but apparently nobody has complained, so they
    won't fix these words nor propose changing the standard.

    An alternative (and probably less work than changing the standard) is
    to fix SwiftForth (e.g., by special-casing the dual-sematics words in NAME>INTERPRET and NAME>COMPILE), but it's even less work is to let
    sleeping dogs lie.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Pelc@21:1/5 to Anthony Howe on Tue Sep 17 23:04:25 2024
    On 17 Sep 2024 at 21:12:08 CEST, "Anthony Howe" <achowe@snert.com> wrote:

    On 2024-09-17 06:54, Ruvim wrote:
    Do you think that the Forth standard should recognize the classic single-xt >> approach as possible for implementing a standard Forth system?

    The classic single-xt approach implies that only one execution token (xt) is >> associated with a name token (nt), and only one name token is associated with a
    word (a named Forth definition). And words whose compilation semantics differ
    form default compilation semantics are implemented as immediate words.

    Given I prefer single-xt (currently), what I don't get is how for a dual-xt system you define a single word with two actions for interpret and compile. I don't see a word to distinguish between the two, except maybe IMMEDIATE.

    VFX Forth 64 is a single xt system (with sub-xts) . It manages to separate compilation and interpret actions for a word cleanly. S" is defined as below:

    : S" \ Comp: "ccc<quote>" -- ; Run: -- c-addr u 6.1.2165
    \ *G Describe a string. Text is taken up to the next double-quote
    \ ** character. The address and length of the string are returned.
    [char] " parse >syspad
    ;
    ndcs: ( -- ) discard-sinline compile (s") ", ;

    NDCS: describes the non-default compilation sematics of the word. The
    process of arriving at this model is described in several recent EuroForth papers.
    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)78 0390 3612, +34 649 662 974
    http://www.mpeforth.com
    MPE website
    http://www.vfxforth.com/downloads/VfxCommunity/
    downloads

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mhx@21:1/5 to Ruvim on Wed Sep 18 06:38:40 2024
    On Wed, 18 Sep 2024 6:10:29 +0000, Ruvim wrote:
    [..]
    This implementation is not standard compliant, because `compile,`, which shall has stack effect ( xt -- ), consumes and produces some other stack parameters for some xts, e.g.
    [..]

    Or, in a standard program:

    : test-compile(
    state @ 0= -14 and throw
    bl word find if compile, else -13 throw then
    parse-name s" )" compare abort" ')' expected"
    ; immediate

    : foo test-compile( if ) ;

    \ Err# -22 ERR: Control structure mismatch.

    FORTH> see foo
    Flags: ANSI
    $01340E40 : foo
    $01340E4A jmp IF+10 ( $012B829A ) offset NEAR
    $01340E4F ;

    I'm curious what this tells you.

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerry Jackson@21:1/5 to Ruvim on Wed Sep 18 21:59:36 2024
    On 18/09/2024 09:44, Ruvim wrote:
    On 2024-09-17 22:58, Anthony Howe wrote:
    On 2024-09-17 07:59, Ruvim wrote:
    On 2024-09-17 15:20, minforth wrote:
    I would like to see an "officially recognized" standard reference
    system, speed and number of xt's per word are of no importance.

    Are you planning to make one?

    I think, having the single standard reference implementation is a big
    step back in Forth standardization process. Because implementation
    details of the particular implementation will be used as requirements.

    I think it should be recognised in some capacity, given Forth's
    origins, but whether there should be a reference implementation
    probably not.


    I think, the standard conformance test suite is enough.

    One would think so, but the test suite is:

    * incomplete
    * as published in draft 19-1 has typos and possible errors
    * test cases often test multiple words at once that have not be tested
    separately
    * assumes the entire draft with all the optional sets are present,
    rather than separate the word sets into separate unit tests

    There is another testsuite: https://github.com/gerryjackson/forth2012-test-suite

    Just to put the record straight, The Forth Test suite in the Forth 200X standard draft 19.1 incorporates most of my test suite with the addition
    of, for example, tests for new words such as FIND-NAME and FIND-NAME-IN.



    I have an idea for a testsuite that:
      — is a ready-to-use program;
      — does not use words from optional word sets (for that, all the
    source files are transpiled into a single file that can be passed to
    stdin);
      — does not change the host Forth system (for example, does not add
    the missed standard words);
      — has an external program that parses output of the testsuite from
    the host's Forth system stdout and generates a report in text/xml/xhtml
    form;
      — includes into the report general information such as implemented words and word sets, implementation options (that can be inferred by a standard program), the behavior of some words in edge cases, etc., along
    with the lists of passed and failed tests;
      — has a configuration for a number of known systems (that is extended by the community);

    Some of these, particularly the reporting has been suggested before but,
    as you pointed out elsewhere everybody is an unpaid volunteer and nobody
    has found the time or motivation to undertake such extensions. Are you volunteering? I've just requested that the Forth 200X committee find
    someone else to take over my test suite - so feel free to volunteer.

    One thing not included in the Test Suite in the standard, as far as I
    can see, and not mentioned in your wish list is that the Hayes tester
    assumes so much of the system is working before the tests actually start
    - how do you test the tester? I thought about this and developed a
    preliminary test based on the assumption that for automated testing at
    least the interpreter must work. So it starts by using SOURCE TYPE (
    comments ) and CR to output messages and include a commentary of how the
    tests progress. If the displays are correct it tests >IN manipulation
    and uses it as an interpretive IF to actually detect errors. Then it
    goes on to do a basic test of the words used in the Hayes tester and so
    on. This is included in the link above.

    --
    Gerry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to do-not-use@swldwa.uk on Thu Sep 19 10:17:44 2024
    In article <vcfevo$6m9q$1@dont-email.me>,
    Gerry Jackson <do-not-use@swldwa.uk> wrote:
    <SNIP>
    Some of these, particularly the reporting has been suggested before but,
    as you pointed out elsewhere everybody is an unpaid volunteer and nobody
    has found the time or motivation to undertake such extensions. Are you >volunteering? I've just requested that the Forth 200X committee find
    someone else to take over my test suite - so feel free to volunteer.

    One thing not included in the Test Suite in the standard, as far as I
    can see, and not mentioned in your wish list is that the Hayes tester >assumes so much of the system is working before the tests actually start
    - how do you test the tester? I thought about this and developed a >preliminary test based on the assumption that for automated testing at
    least the interpreter must work. So it starts by using SOURCE TYPE (
    comments ) and CR to output messages and include a commentary of how the >tests progress. If the displays are correct it tests >IN manipulation
    and uses it as an interpretive IF to actually detect errors. Then it
    goes on to do a basic test of the words used in the Hayes tester and so
    on. This is included in the link above.

    Practically speaking. ciforth went from a working fig-forth 16 bits i86
    to a working 386 to a working ISO Forth to linux 32 and 64 i86
    and linux 32 and 64 arm , to a linux 64 risc-V.
    What you describe is worthwhile, but not needed in most cases.
    A c-based compiler like gforth will most likely work essentially
    on the first try.

    (Appreciate your work on extending the tests.)


    --
    Gerry

    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to the.beez.speaks@gmail.com on Thu Sep 19 10:36:07 2024
    In article <nnd$6175d1e4$764cd6e1@f82f45a6e9247add>,
    Hans Bezemer <the.beez.speaks@gmail.com> wrote:
    On 18-09-2024 12:34, Ruvim wrote:
    Actually, most Forth systems are classic single-xt systems. And most
    educational materials on how to implement Forth explain the classic
    single-xt approach.

    Interesting enough - considering this "dual xt" idea, 4tH has *ALWAYS*
    been "dual xt". All compilation behavior is in the compiler and all
    execution behavior is in the interpreter. Note 4tH *only* contains >primitives. The Forth layer is what you build with these primitives,
    since both the compilation behavior and execution behavior is coded in C.

    And the opposite approach. Always have default compilation semantics,
    i.e. add the behaviour of an interpreted word to a compiled word.
    Do not allow STATE dependant behaviour except for denotations:
    single words that leave a constant or several constant(s) on
    the stack, but this must be the same value for interpretation and interpretation. 1)
    They are compiled as literals in compilation mode.
    Do not allow to postpone denotations (use literal for that),
    do not allow any other state smart words.

    Forth doesn't become less powerful, only less interesting for
    language lawyers.
    If the compilation stack is separate, inspection of STATE
    can be restricted to INTERPRET , without even a need to
    be inspected by number, aka denotations.
    INTERPRET could simply inspect if the stack has changed.
    In compile mode, it compiles literals, instead of leaving
    them on the stack.

    (Chuck Moore would/should like this.)

    The only reason to have dual xt if you want to do
    optimisation in the compilation xt.


    1) Note that a :NONAME construction is an denotation, leaving a
    constant xt.


    Hans Bezemer


    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)