• Re: Parsing timestamps?

    From dxf@dxforth@gmail.com to comp.lang.forth on Sat Jul 5 12:25:08 2025
    From Newsgroup: comp.lang.forth

    On 4/07/2025 8:01 pm, albert@spenarnc.xs4all.nl wrote:
    In article <300ba9a1581bea9a01ab85d5d361e6eaeedbf23a@i2pn2.org>,
    dxf <dxforth@gmail.com> wrote:
    On 3/07/2025 10:51 pm, albert@spenarnc.xs4all.nl wrote:
    ...
    I like to remind of the youtube FORTH2020 of Wagner. This concerns
    motions of aircraft, position speed, pitch roll and yaw etc.
    Terribly complicated, no LOCAL's. There was a question whether LOCAL's
    could have made Wagners code easier.
    He stated the ideal (paraphrased by me) that "code is its own comment"

    That was an interesting video even if more a rundown of his (long) history >> as a professional forth programmer. Here's the link for anyone curious:

    https://youtu.be/V9ES9UZHaag

    He said he uses the hardware fp stack for speed. Is he really only
    using 8 levels of stack?

    8 level is plenty as long as you refrain from recursion that in
    Wagners context would be not even remotely useful.

    Puzzling because of a thread here not long ago in which scientific users
    appear to suggest the opposite. Such concerns have apparently been around
    a long time:

    https://groups.google.com/g/comp.lang.forth/c/CApt6AiFkxo/m/wwZmc_Tr1PcJ


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Jul 5 18:02:14 2025
    From Newsgroup: comp.lang.forth

    On 3/07/2025 10:17 pm, albert@spenarnc.xs4all.nl wrote:
    In article <nnd$57e17bcd$463b2e07@d86e5bbc05746f06>,
    Hans Bezemer <the.beez.speaks@gmail.com> wrote:
    On 03-07-2025 01:59, Paul Rubin wrote:
    Hans Bezemer <the.beez.speaks@gmail.com> writes:
    1. Adding general locals is trivial. It takes just one single line of
    Forth.

    I don't see how to do it in one line, and trivial is a subjective term.
    I'd say in any case that it's not too difficult, but one line seems
    overoptimistic. Particularly, you need something like (LOCAL) in the
    VM. The rest is just some extensions to the colon compiler. Your
    mention of it taking 3-4 screens sounded within reason to me, and I
    don't consider that to be a lot of code.

    "Short" in my dictionary is. One. Single. Screen. No more. No less (pun
    intended).

    And this one is one single screen. Even with the dependencies.
    https://youtu.be/FH4tWf9vPrA

    Typical use:

    variable a
    variable b

    : divide
    local a
    local b

    b ! a ! a @ b @ / ;

    Does recursion, the whole enchilada. One line.
    Thanks to Fred Behringer - and Albert, who condensed it to a single
    single line definition. Praise is where praise is due.

    Although 'local variables' like this are much preferred (superior) ,
    LOCAL (value) is what is asked for.
    If you don't have the akward, forward parsing TO already defined, you
    are bound to do more work.

    OTOH those that use locals will likely be wanting the 'standard' one.
    When ANS didn't deliver the locals users wanted all hell broke loose.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sat Jul 5 08:49:22 2025
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    [8 stack items on the FP stack]
    Puzzling because of a thread here not long ago in which scientific users >appear to suggest the opposite. Such concerns have apparently been around
    a long time:

    https://groups.google.com/g/comp.lang.forth/c/CApt6AiFkxo/m/wwZmc_Tr1PcJ

    I have read through the thread. It's unclear to me which scientific
    users you have in mind. My impression is that 8 stack items was
    deemed sufficient by many, and preferable (on 387) for efficiency
    reasons.

    Certainly, of the two points this thread is about, there was a
    Forth200x proposal for standardizing a separate FP stack, and this
    proposal was accepted. There was no proposal for increasing the
    minimum size of the FP stack; Forth-2012 still says:

    |The size of a floating-point stack shall be at least 6 items.

    One interesting aspect is that VFX 5.x finally includes an FP package
    by default, and it started by including an SSE2-based FP package which
    supports a deep FP stack. However, MPE received customer complaints
    about the lower number of significant digits in SSE2 (binary64)
    vs. 387 (80-bit FP values), so they switched the default to the
    387-based FP package that only has 8 FP stack items. Apparently no
    MPE customer complains about that limitation.

    OTOH, iForth-5.1-mini uses the 387 instructions, but stores FP stack
    items in memory at least on call boundaries. Maybe Marcel Hendrix can
    give some insight into what made him take this additional
    implementation effort.


    FORTH> : foo f+ f* ; ok
    FORTH> : bar f@ f@ f@ execute f! ; ok
    FORTH> ' foo idis
    $10226000 : foo 488BC04883ED088F4500 H.@H.m..E. $1022600A fld [r13 0 +] tbyte41DB6D00 A[m. $1022600E fld [r13 #16 +] tbyte
    41DB6D10 A[m. $10226012 fxch ST(2) D9CA YJ
    $10226014 lea r13, [r13 #32 +] qword
    4D8D6D20 M.m $10226018 faddp ST(1), ST DEC1 ^A
    $1022601A fxch ST(1) D9C9 YI
    $1022601C fpopswap, 41DB6D00D9CA4D8D6D10 A[m.YJM.m. $10226026 fmulp ST(1), ST DEC9 ^I
    $10226028 fpush, 4D8D6DF0D9C941DB7D00 M.mpYIA[}. $10226032 ; 488B45004883C508FFE0 H.E.H.E..` ok FORTH> ' bar idis
    $10226080 : bar 488BC04883ED088F4500 H.@H.m..E. $1022608A pop rbx 5B [
    $1022608B fld [rbx] tbyte DB2B [+
    $1022608D pop rbx 5B [
    $1022608E fld [rbx] tbyte DB2B [+
    $10226090 pop rbx 5B [
    $10226091 fld [rbx] tbyte DB2B [+
    $10226093 lea r13, [r13 #-48 +] qword
    4D8D6DD0 M.mP $10226097 fxch ST(3) D9CB YK
    $10226099 fstp [r13 #32 +] tbyte
    41DB7D20 A[} $1022609D fstp [r13 0 +] tbyte41DB7D00 A[}. $102260A1 fstp [r13 #16 +] tbyte
    41DB7D10 A[}. $102260A5 pop rbx 5B [
    $102260A6 or rbx, rbx 4809DB H.[
    $102260A9 je $102260B1 offset NEAR
    0F8402000000 ...... $102260AF call rbx FFD3 .S
    $102260B1 pop rbx 5B [
    $102260B2 fpop, 41DB6D00D9C94D8D6D10 A[m.YIM.m. $102260BC fstp [rbx] tbyte DB3B [;
    $102260BE ; 488B45004883C508FFE0 H.E.H.E..` ok

    - 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 2023 proceedings: http://www.euroforth.org/ef23/papers/
    EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sat Jul 5 14:21:44 2025
    From Newsgroup: comp.lang.forth

    In article <2025Jul5.104922@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    <SNIP>
    One interesting aspect is that VFX 5.x finally includes an FP package
    by default, and it started by including an SSE2-based FP package which >supports a deep FP stack. However, MPE received customer complaints
    about the lower number of significant digits in SSE2 (binary64)
    vs. 387 (80-bit FP values), so they switched the default to the
    387-based FP package that only has 8 FP stack items. Apparently no
    MPE customer complains about that limitation.

    Interesting indeed! I would rather expect customers to complain
    about not IEEE compliance.


    OTOH, iForth-5.1-mini uses the 387 instructions, but stores FP stack
    items in memory at least on call boundaries. Maybe Marcel Hendrix can
    give some insight into what made him take this additional
    implementation effort.

    Once an assembler is in place, using only the internal stack
    fp merely costs 23 screens in ciforth. This includes transcendental
    functions, that are mostly a wrapper around an assembler instruction:
    CODE FCOS FCOS, NEXT, END-CODE
    The most involved are hyperbolic sine etc, that must be constructed
    by combining exponentials and demands ranges.

    I investigated the instruction set, and I found no way to detect
    if the 8 registers stack is full.
    This would offer the possibility to spill registers to memory only
    if it is needed.

    - anton
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From minforth@minforth@gmx.net to comp.lang.forth on Sat Jul 5 14:41:11 2025
    From Newsgroup: comp.lang.forth

    Am 05.07.2025 um 14:21 schrieb albert@spenarnc.xs4all.nl:
    I investigated the instruction set, and I found no way to detect
    if the 8 registers stack is full.
    This would offer the possibility to spill registers to memory only
    if it is needed.


    IIRC signaling and handling fp-stack overflow is not an easy task.
    At most, the computer would crash.
    IOW, spilling makes sense.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From minforth@minforth@gmx.net to comp.lang.forth on Sat Jul 5 16:24:37 2025
    From Newsgroup: comp.lang.forth

    Am 05.07.2025 um 14:41 schrieb minforth:
    Am 05.07.2025 um 14:21 schrieb albert@spenarnc.xs4all.nl:
    I investigated the instruction set, and I found no way to detect
    if the 8 registers stack is full.
    This would offer the possibility to spill registers to memory only
    if it is needed.


    IIRC signaling and handling fp-stack overflow is not an easy task.
    At most, the computer would crash.
    IOW, spilling makes sense.

    A deep dive into the manual

    .. the C1 condition code flag is used for a variety of functions.
    When both the IE and SF flags in the x87 FPU status word are set,
    indicating a stack overflow or underflow exception (#IS), the C1
    flag distinguishes between overflow (C1=1) and underflow (C1=0).

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sat Jul 5 14:28:02 2025
    From Newsgroup: comp.lang.forth

    minforth <minforth@gmx.net> writes:
    Am 05.07.2025 um 14:21 schrieb albert@spenarnc.xs4all.nl:
    I investigated the instruction set, and I found no way to detect
    if the 8 registers stack is full.
    This would offer the possibility to spill registers to memory only
    if it is needed.


    IIRC signaling and handling fp-stack overflow is not an easy task.

    The stopry I read is that Kahan and the 8087 architects intended to
    support extending the 8087 stack into memory with an exception
    handler, but that part of the specification did not get implemented as intended, and it was then extremely hard or impossible to implement
    that feature. The problem was not noticed until after it was too
    late; apparently 8 stack items was sufficient for most uses also
    outside the Forth context, too.

    - 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 2023 proceedings: http://www.euroforth.org/ef23/papers/
    EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Jul 6 12:52:37 2025
    From Newsgroup: comp.lang.forth

    On 5/07/2025 6:49 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    [8 stack items on the FP stack]
    Puzzling because of a thread here not long ago in which scientific users
    appear to suggest the opposite. Such concerns have apparently been around >> a long time:

    https://groups.google.com/g/comp.lang.forth/c/CApt6AiFkxo/m/wwZmc_Tr1PcJ

    I have read through the thread. It's unclear to me which scientific
    users you have in mind. My impression is that 8 stack items was
    deemed sufficient by many, and preferable (on 387) for efficiency
    reasons.

    AFAICS both Skip Carter (proponent) and Julian Noble were suggesting the
    6 level minimum were inadequate. A similar sentiment was expressed here
    only several months ago. AFAIK all major forths supporting x87 hardware
    offer software stack options.

    Certainly, of the two points this thread is about, there was a
    Forth200x proposal for standardizing a separate FP stack, and this
    proposal was accepted. There was no proposal for increasing the
    minimum size of the FP stack; Forth-2012 still says:

    |The size of a floating-point stack shall be at least 6 items.

    Only because nothing further was heard. What became of the review
    Elizabeth announced I've no idea.

    One interesting aspect is that VFX 5.x finally includes an FP package
    by default, and it started by including an SSE2-based FP package which supports a deep FP stack. However, MPE received customer complaints
    about the lower number of significant digits in SSE2 (binary64)
    vs. 387 (80-bit FP values), so they switched the default to the
    387-based FP package that only has 8 FP stack items. Apparently no
    MPE customer complains about that limitation.
    ...

    AFAIK x87 hardware stack was always MPE's main and best supported FP
    package. As for SSE2 it wouldn't exist if industry didn't consider double-precision adequate. My impression of MPE's SSE2 implementation
    is that it's 'a work in progress'. The basic precision is there but transcendentals appear to be limited to single-precision. That'd be
    the reason I'd stick with MPE's x87 package. Other reason is it's now
    quite difficult and error-prone to switch FP packages as it involves
    rebuilding the system. The old scheme was simpler and idiot-proof.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Stephen Pelc@stephen@vfxforth.com to comp.lang.forth on Sun Jul 6 08:46:53 2025
    From Newsgroup: comp.lang.forth

    On 6 Jul 2025 at 04:52:37 CEST, "dxf" <dxforth@gmail.com> wrote:

    On 5/07/2025 6:49 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    [8 stack items on the FP stack]
    Puzzling because of a thread here not long ago in which scientific users >>> appear to suggest the opposite. Such concerns have apparently been around >>> a long time:

    https://groups.google.com/g/comp.lang.forth/c/CApt6AiFkxo/m/wwZmc_Tr1PcJ

    I have read through the thread. It's unclear to me which scientific
    users you have in mind. My impression is that 8 stack items was
    deemed sufficient by many, and preferable (on 387) for efficiency
    reasons.

    AFAICS both Skip Carter (proponent) and Julian Noble were suggesting the
    6 level minimum were inadequate. A similar sentiment was expressed here
    only several months ago. AFAIK all major forths supporting x87 hardware offer software stack options.

    Certainly, of the two points this thread is about, there was a
    Forth200x proposal for standardizing a separate FP stack, and this
    proposal was accepted. There was no proposal for increasing the
    minimum size of the FP stack; Forth-2012 still says:

    |The size of a floating-point stack shall be at least 6 items.

    Only because nothing further was heard. What became of the review
    Elizabeth announced I've no idea.

    One interesting aspect is that VFX 5.x finally includes an FP package
    by default, and it started by including an SSE2-based FP package which
    supports a deep FP stack. However, MPE received customer complaints
    about the lower number of significant digits in SSE2 (binary64)
    vs. 387 (80-bit FP values), so they switched the default to the
    387-based FP package that only has 8 FP stack items. Apparently no
    MPE customer complains about that limitation.
    ...

    AFAIK x87 hardware stack was always MPE's main and best supported FP
    package. As for SSE2 it wouldn't exist if industry didn't consider double-precision adequate. My impression of MPE's SSE2 implementation
    is that it's 'a work in progress'. The basic precision is there but transcendentals appear to be limited to single-precision. That'd be
    the reason I'd stick with MPE's x87 package. Other reason is it's now
    quite difficult and error-prone to switch FP packages as it involves rebuilding the system. The old scheme was simpler and idiot-proof.

    You do not have to rebuild the system to switch. Just read the manual.

    "The old scheme was simpler and idiot-proof." Yes, that's why we
    did it that way, but a certain "guru" who only does testing kept
    moaning. If people would prefer us to go back to the old scheme,
    VFX 6 still has time for changes. The whole idea that compiling
    one file is improper is very non-Forth, or even anti-Forth.

    I may be getting grumpier as I get older.

    Stephen
    --
    Stephen Pelc, stephen@vfxforth.com
    Wodni & Pelc GmbH
    Vienna, Austria
    Tel: +44 (0)7803 903612, +34 649 662 974 http://www.vfxforth.com/downloads/VfxCommunity/
    free VFX Forth downloads
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Jul 6 20:29:01 2025
    From Newsgroup: comp.lang.forth

    On 6/07/2025 6:46 pm, Stephen Pelc wrote:
    On 6 Jul 2025 at 04:52:37 CEST, "dxf" <dxforth@gmail.com> wrote:

    On 5/07/2025 6:49 pm, Anton Ertl wrote:
    ...
    One interesting aspect is that VFX 5.x finally includes an FP package
    by default, and it started by including an SSE2-based FP package which
    supports a deep FP stack. However, MPE received customer complaints
    about the lower number of significant digits in SSE2 (binary64)
    vs. 387 (80-bit FP values), so they switched the default to the
    387-based FP package that only has 8 FP stack items. Apparently no
    MPE customer complains about that limitation.
    ...

    AFAIK x87 hardware stack was always MPE's main and best supported FP
    package. As for SSE2 it wouldn't exist if industry didn't consider
    double-precision adequate. My impression of MPE's SSE2 implementation
    is that it's 'a work in progress'. The basic precision is there but
    transcendentals appear to be limited to single-precision. That'd be
    the reason I'd stick with MPE's x87 package. Other reason is it's now
    quite difficult and error-prone to switch FP packages as it involves
    rebuilding the system. The old scheme was simpler and idiot-proof.

    You do not have to rebuild the system to switch. Just read the manual.

    If you mean:

    integers
    remove-FP-pack
    include FPSSE64S.fth

    That works - however everything that was defined after VFXFORTH is gone.
    In the case of Windows at least it leaves the system in a fragile state.
    I did find a way to recompile the forgotten stuff but it involved editing
    paths and files etc.


    --- Synchronet 3.21a-Linux NewsLink 1.2