Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Truly simple systems... require infinite testing. -- Norman Augustine


devel / comp.lang.forth / Re: Another example of factoring and locals

SubjectAuthor
* Another example of factoring and localsAnton Ertl
`* Re: Another example of factoring and localsdxforth
 `* Re: Another example of factoring and localsAnton Ertl
  `* Re: Another example of factoring and localsdxforth
   `* Re: Another example of factoring and localsHans Bezemer
    `* Re: Another example of factoring and localsAnton Ertl
     `* Re: Another example of factoring and localsdxforth
      +* Re: Another example of factoring and localsPaul Rubin
      |+* Re: Another example of factoring and localsminf...@arcor.de
      ||+* Re: Another example of factoring and localsHans Bezemer
      |||+* Re: Another example of factoring and localsPaul Rubin
      ||||`* Re: Another example of factoring and localsdxforth
      |||| `* Re: Another example of factoring and localsPaul Rubin
      ||||  `* Re: Another example of factoring and localsdxforth
      ||||   `* Re: Another example of factoring and localsPaul Rubin
      ||||    +* Re: Another example of factoring and localsdxforth
      ||||    |+* Re: Another example of factoring and localsMarcel Hendrix
      ||||    ||`* Re: Another example of factoring and localsPaul Rubin
      ||||    || `* Re: Another example of factoring and localsdxforth
      ||||    ||  `- Re: Another example of factoring and localsMarcel Hendrix
      ||||    |+* Re: Another example of factoring and localsS Jack
      ||||    ||`- Re: Another example of factoring and localsdxforth
      ||||    |`* Re: Another example of factoring and localsPaul Rubin
      ||||    | +* Re: Another example of factoring and localsdxforth
      ||||    | |+* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||+* Re: Another example of factoring and localsDoug Hoffman
      ||||    | |||+* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||+- Re: Another example of factoring and localsnone
      ||||    | ||||`* Re: Another example of factoring and localsDoug Hoffman
      ||||    | |||| +- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | |||| +- Re: Another example of factoring and localsdxforth
      ||||    | |||| `* Re: Another example of factoring and localsdxforth
      ||||    | ||||  `* Re: Another example of factoring and localsDoug Hoffman
      ||||    | ||||   `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    +- Re: Another example of factoring and localsHans Bezemer
      ||||    | ||||    +- Re: Another example of factoring and localsBrian Fox
      ||||    | ||||    +* Re: Another example of factoring and localsDoug Hoffman
      ||||    | ||||    |`* Re: Another example of factoring and localsdxforth
      ||||    | ||||    | `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |  `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |   `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |    `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |     `* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    |      `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |       `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |        `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |         `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |          `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |           +* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    |           |+- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |           |`- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |           `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            +* Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |`* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    |            | +- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            | +- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            | `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  +* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |  |+* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |  ||`* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |  || `- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |  |`* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  | +- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |  | `* Re: Another example of factoring and localsHans Bezemer
      ||||    | ||||    |            |  |  `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  |   `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |  |    `- Re: Another example of factoring and localsdave thompson 2
      ||||    | ||||    |            |  `* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    |            |   `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |    `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |     +- Re: Another example of factoring and localsnone
      ||||    | ||||    |            |     `- Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            +* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |+- Re: Another example of factoring and localsnone
      ||||    | ||||    |            |`- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            +- Re: Another example of factoring and localsnone
      ||||    | ||||    |            +* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |+- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |`* Re: Another example of factoring and localsHans Bezemer
      ||||    | ||||    |            | `* Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |  +* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  |`* Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |  | +* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |  | |+- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |  | |`- Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  | `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |  |  `- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | ||||    |            |  `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |   `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |    `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |     `* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |      +* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |      |`* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |      | `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |      |  +* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    |            |      |  |`- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |      |  +* Re: Another example of factoring and localsAnton Ertl
      ||||    | ||||    |            |      |  |`* Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |      |  | `* Re: Another example of factoring and localsnone
      ||||    | ||||    |            |      |  |  `- Re: Another example of factoring and localsdxforth
      ||||    | ||||    |            |      |  `* Re: Another example of factoring and localsPaul Rubin
      ||||    | ||||    |            |      `* Re: Another example of factoring and localsnone
      ||||    | ||||    |            +* Re: Another example of factoring and localsLars Brinkhoff
      ||||    | ||||    |            `* Re: Another example of factoring and localsdxforth
      ||||    | ||||    +- Re: Another example of factoring and localsHans Bezemer
      ||||    | ||||    +* Re: Another example of factoring and localsMarcel Hendrix
      ||||    | ||||    +- Re: Another example of factoring and localsHans Bezemer
      ||||    | ||||    +- Re: Another example of factoring and localsP Falth
      ||||    | ||||    `- Re: Another example of factoring and localsminf...@arcor.de
      ||||    | |||`* Re: Another example of factoring and localsHans Bezemer
      ||||    | ||+- Re: Another example of factoring and localsdxforth
      ||||    | ||`* Re: Another example of factoring and localsHans Bezemer
      ||||    | |`- Re: Another example of factoring and localsnone
      ||||    | +- Re: Another example of factoring and localsStephen Pelc
      ||||    | `* Re: Another example of factoring and localsantispam
      ||||    +- Re: Another example of factoring and localsHans Bezemer
      ||||    `- Re: Another example of factoring and localsHans Bezemer
      |||`* Re: Another example of factoring and localsGerry Jackson
      ||`* Re: Another example of factoring and localsPaul Rubin
      |+- Re: Another example of factoring and localsHans Bezemer
      |`* Re: Another example of factoring and localsdxforth
      `* Re: Another example of factoring and localsHans Bezemer

Pages:123456789
Re: Another example of factoring and locals

<e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5893:0:b0:3a5:822b:e370 with SMTP id t19-20020ac85893000000b003a5822be370mr16107668qta.11.1668014307245;
Wed, 09 Nov 2022 09:18:27 -0800 (PST)
X-Received: by 2002:a25:aba9:0:b0:6c9:eb26:b782 with SMTP id
v38-20020a25aba9000000b006c9eb26b782mr60400518ybi.166.1668014306987; Wed, 09
Nov 2022 09:18:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 9 Nov 2022 09:18:26 -0800 (PST)
In-Reply-To: <nnd$06f26bb1$30bda3c4@4df1ca99aae48033>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f14:6b37:743b:f53:ce8b:689e;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f14:6b37:743b:f53:ce8b:689e
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <nnd$06f26bb1$30bda3c4@4df1ca99aae48033>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Wed, 09 Nov 2022 17:18:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3050
 by: minf...@arcor.de - Wed, 9 Nov 2022 17:18 UTC

none albert schrieb am Mittwoch, 9. November 2022 um 14:59:51 UTC+1:
> In article <2022Nov...@mips.complang.tuwien.ac.at>,
> Anton Ertl <an...@mips.complang.tuwien.ac.at> wrote:
> <SNIP>
> >
> >[1] FAXPY ( ra f-x nstridex f-y nstridey ucount -- ) multiplies ra
> >with f-x and adds the result to f-y, where f-x and f-y are arrays and
> >ucount elements are accessed with strides nstridex and nstridey,
> >respectively. This is the Forth float variant of BLAS's SAXPY,
> >DAXPY, CAXPY and ZAXPY routines.
> This can be done with nested loops: I and J
> Rejecting local variables and then using I and J
> (actually similar to adding a special A registers.)
> that are a sort of register variables with a special purpose?
> I have to admit that feels like cheating.
> It makes the case for locals stronger, but local
> TO-VALUEs have the same cludgy feeling as I and J.
>

Any 'reasonable' implementation would use CPU vector registers
when available. So any argumentation based on single scalar
stack or local elements (these are the only ones treated in the
Forth standard) barely counts.

The BLAS interfaced is explained here:
https://www.ibm.com/docs/en/essl/6.2?topic=vss-saxpy-daxpy-caxpy-zaxpy-multiply-vector-by-scalar-add-vector-store-in-vector

With my non-standard array/buffer/matrix locals I could define this in
a one-liner:
: DAXPY { f: ra M: X Y == Y } ra X mscale Y m+ ;
\ mscale : vectorized scalar multiply
\ m+ : vectorized add
Alternatively: looping over all elements and applying fused multiply-add
function FMA; there are many ways to Rome.

So limiting oneself to what the Standard or Mr. Moore said or not said
is close to mental self-multilation IMO.

Re: Another example of factoring and locals

<2022Nov9.182238@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Wed, 09 Nov 2022 17:22:38 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 22
Message-ID: <2022Nov9.182238@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com> <tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com> <tkb4qc$1d6b$1@gioia.aioe.org> <4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com> <38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com> <tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <tkg4fj$18f$1@gioia.aioe.org>
Injection-Info: reader01.eternal-september.org; posting-host="72fcd20bee8a7680beeb00f04327c666";
logging-data="301269"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CbTTwcphf1ukKZWkDFteC"
Cancel-Lock: sha1:8kkFIAa0w2HEuIITnzazYXN+Dh4=
X-newsreader: xrn 10.11
 by: Anton Ertl - Wed, 9 Nov 2022 17:22 UTC

dxforth <dxforth@gmail.com> writes:
>On 9/11/2022 8:33 pm, Anton Ertl wrote:
>> ...
>> One reason for having locals was for implementing words that
>> have so many items in constant use that a pure-stack variant is
>> cumbersome.
>
>Both are complicated solutions AFAICS. One has lots of stack
>operations and the other has lots of variables. They're as bad
>as each other. Were folks to see that, they might look for
>another solution.

What would be your solution? Elizabeth Rather suggested assembler,
and I expect that's what Chuck Moore used before doing his own
hardware. On i21 he then added A and enhanced R.

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

Re: Another example of factoring and locals

<2022Nov9.182610@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Wed, 09 Nov 2022 17:26:10 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 69
Message-ID: <2022Nov9.182610@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <nnd$06f26bb1$30bda3c4@4df1ca99aae48033>
Injection-Info: reader01.eternal-september.org; posting-host="72fcd20bee8a7680beeb00f04327c666";
logging-data="315568"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+i5UxEYWKJulr0oNLEOqNX"
Cancel-Lock: sha1:/9xEoWFwwVjewl+k0jvarGDQCMk=
X-newsreader: xrn 10.11
 by: Anton Ertl - Wed, 9 Nov 2022 17:26 UTC

albert@cherry.(none) (albert) writes:
>In article <2022Nov9.103332@mips.complang.tuwien.ac.at>,
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
><SNIP>
>>
>>[1] FAXPY ( ra f-x nstridex f-y nstridey ucount -- ) multiplies ra
>>with f-x and adds the result to f-y, where f-x and f-y are arrays and
>>ucount elements are accessed with strides nstridex and nstridey,
>>respectively. This is the Forth float variant of BLAS's SAXPY,
>>DAXPY, CAXPY and ZAXPY routines.
>
>This can be done with nested loops: I and J

Please demonstrate. I see only one loop.

>Rejecting local variables and then using I and J
>(actually similar to adding a special A registers.)
>that are a sort of register variables with a special purpose?
>I have to admit that feels like cheating.

Unlike the A register, the loop parameters are stack-managed.

But note that machine Forth (and, I think, colorForth) has no
?DO...LOOP.

So let's do a few Forth variants of AXPY (the integer sibling of
FAXPY, probably not needed by anyone, but similar to what we would see
for FAXPY with 1-cell floats; all untested):

\ Gforth with locals
: axpy1 {: na a-x nstridex a-y nstridey ucount -- :}
a-x a-y ucount 0 ?do {: a-x1 a-y1 :}
a-x1 @ na * a-y1 +!
a-x1 nstridex + a-y1 nstridey + loop
2drop ;

\ Standard Forth without locals
: axpy2 ( na a-x nstridex a-y nstridey ucount -- )
>r >r rot r> swap rot r> 0 do ( na nstridex nstridey a-x1 a-y1 )
over @ 5 pick * over +!
2over rot + >r + r> loop
2drop 2drop drop ;

\ Standard Forth without locals, loop, and with tail recursion (machine-Forth-like)
: axpy3 ( na a-x nstridex a-y nstridey ucount -- )
dup 0> if
4 pick @ 6 pick * 3 pick +!
>r dup >r + >r dup >r + r> r> r> r> 1- recurse
then ;

Ok, writing AXPY2 and AXPY3 was not too hard, but reading is a
different issue.

I guess that Chuck Moore would consider the stride parameters to be
too general and would eliminate them; and that's usually also a good
idea on current general-purpose architectures: try to arrange your
data so that the x and y array elements you access are contiguous,
possibly by copying them around first (which pays off if you then
access the array more than once); and in Forth splitting axpy into
rearrangement, computation, and rearrangement (with the rearrangement
steps hopefully unnecessary) would reduce the number of needed items
accessed in each loop.

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

Re: Another example of factoring and locals

<fd1e503d-750a-4085-beda-8c147b3e9887n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:2b49:b0:6fa:67fb:4428 with SMTP id dp9-20020a05620a2b4900b006fa67fb4428mr27901785qkb.96.1668020596871;
Wed, 09 Nov 2022 11:03:16 -0800 (PST)
X-Received: by 2002:a25:3455:0:b0:6d3:9217:4b4e with SMTP id
b82-20020a253455000000b006d392174b4emr27481909yba.391.1668020596554; Wed, 09
Nov 2022 11:03:16 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.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: Wed, 9 Nov 2022 11:03:16 -0800 (PST)
In-Reply-To: <tkgmoh$1eh3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f14:6b37:743b:f53:ce8b:689e;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f14:6b37:743b:f53:ce8b:689e
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <tjcuft$1hjp$1@gioia.aioe.org>
<2022Oct27.123214@mips.complang.tuwien.ac.at> <tjdt15$1s0n$1@gioia.aioe.org>
<df3724de-f372-4c24-8bf4-059962363089n@googlegroups.com> <2022Oct27.182441@mips.complang.tuwien.ac.at>
<tjg2qm$1lbd$1@gioia.aioe.org> <87bkpw73fr.fsf@nightsong.com>
<tji5tj$13t5$1@gioia.aioe.org> <87wn8d0z9g.fsf@nightsong.com>
<tjva23$120s$1@gioia.aioe.org> <87cza4g1do.fsf@nightsong.com> <tkgmoh$1eh3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fd1e503d-750a-4085-beda-8c147b3e9887n@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Wed, 09 Nov 2022 19:03:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 36
 by: minf...@arcor.de - Wed, 9 Nov 2022 19:03 UTC

anti...@math.uni.wroc.pl schrieb am Mittwoch, 9. November 2022 um 18:07:31 UTC+1:
> Paul Rubin <no.e...@nospam.invalid> wrote:
> > dxforth <dxf...@gmail.com> writes:
> > > My point was it went from 4 locals to 6 for reasons of style. It may be
> > > C-style to expend resources this way (I wouldn't know)
> >
> > In C these days, the extra locals wouldn't expend any resources in most
> > cases, since the compiler would optimize them away.
> >
> > > but I doubt it's Moore's.
> >
> > This I don't know. A traditional thread Forth interpreter (Moore's
> > invention) is probably 10x slower than CODE doing the same thing, but
> > Moore only used CODE when he had to. If 9x extra compute cycles is
> > fine, why are a few memory cells a big deal?
>
> I think origin of Forth explain this. In his book "PROGRAMMING
> A PROBLEM-ORIENTED-LANGUAGE" Moore write about "programs with
> input". In more clear language he wanted to have interactive
> command processor. For processing user commands even minis
> from 1970 and early micros have enough speed that you can lose
> some (not too much, but factor of 10 is acceptable). OTOH
> some minis were quite small. More writes about 4kB RAM, but
> I think that he could put only very stripped down system on
> such machine, full system that he outlines probably need
> something between 8 and 16 kB RAM (FIG Forth executable is
> slightly bigger than 6kB, but needs extra memory for block
> buffers and for words defined in Forth).

To get a feeling (nostalgic for us oldtimers) for the available "interactive
command processors" of that time, watch:

https://www.youtube.com/watch?v=_DTpQ4Kk2wA

It is not about Forth but about APL, a very interesting matrix processing
language. But those teletype terminals had been high luxury. We poor
students had to shuffle shoe boxes full with stacks of punch cards around... ;o)

Re: Another example of factoring and locals

<87k0433jqu.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Wed, 09 Nov 2022 13:23:21 -0800
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <87k0433jqu.fsf@nightsong.com>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<874jvd2ita.fsf@nightsong.com> <tk722u$1jq1$1@gioia.aioe.org>
<87zgd41up3.fsf@nightsong.com> <tk7sah$1cne$1@gioia.aioe.org>
<87r0yf1ilv.fsf@nightsong.com>
<6a1d499d-1cc3-4acb-85dd-24838f93d320n@googlegroups.com>
<10839720-ce01-412b-ae79-04d881aace7dn@googlegroups.com>
<2022Nov7.232424@mips.complang.tuwien.ac.at>
<87h6zal5zu.fsf@nightsong.com>
<2022Nov8.103948@mips.complang.tuwien.ac.at>
<6eb99ff9-a9c0-46f2-a2cd-c0fcecd11d90n@googlegroups.com>
<2022Nov9.114302@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="5b9c62f078b607fa721317df85d73b5d";
logging-data="352674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EodNcOW0JCCbpg/C+5L6P"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:sunhPI3SoFmCtRCohxPlegW/6+Q=
sha1:POKHVDQAazbjd94t9T9uO7QeuOY=
 by: Paul Rubin - Wed, 9 Nov 2022 21:23 UTC

anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> Unix as OS, and of Forth as a programming language. Both had no
> memory protection (Unix acquired virtual memory only with 3BSD in
> 1979), both acquired multi-tasking (and multi-user) pretty soon.

Unix had memory protection on the PDP-11, long before it got virtual
memory. The PDP-11/40 and friends had memory segments with protection
registers, so processes couldn't clobber each other or reach into the
kernel. With earlier models (11/20, PDP-7 etc.) you could crash a whole
timesharing system by having a pointer bug in your program. I thought
that Unix had multi-tasking from the beginning, but am not sure.

I'd be interested to know if Forth used memory protection on machines
that had it in that era.

Re: Another example of factoring and locals

<2022Nov9.225950@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Wed, 09 Nov 2022 21:59:50 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 41
Message-ID: <2022Nov9.225950@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <nnd$06f26bb1$30bda3c4@4df1ca99aae48033> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>
Injection-Info: reader01.eternal-september.org; posting-host="72fcd20bee8a7680beeb00f04327c666";
logging-data="358225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iDj20McCAtW1+nyPfOhLN"
Cancel-Lock: sha1:IhBgxSQx1nh0UhbqfbYoBWs09m4=
X-newsreader: xrn 10.11
 by: Anton Ertl - Wed, 9 Nov 2022 21:59 UTC

"minf...@arcor.de" <minforth@arcor.de> writes:
>none albert schrieb am Mittwoch, 9. November 2022 um 14:59:51 UTC+1:
>> In article <2022Nov...@mips.complang.tuwien.ac.at>,
>> Anton Ertl <an...@mips.complang.tuwien.ac.at> wrote:
>> <SNIP>
>> >
>> >[1] FAXPY ( ra f-x nstridex f-y nstridey ucount -- ) multiplies ra
>> >with f-x and adds the result to f-y, where f-x and f-y are arrays and
>> >ucount elements are accessed with strides nstridex and nstridey,
>> >respectively. This is the Forth float variant of BLAS's SAXPY,
>> >DAXPY, CAXPY and ZAXPY routines.
....
>Any 'reasonable' implementation would use CPU vector registers
>when available. So any argumentation based on single scalar
>stack or local elements (these are the only ones treated in the
>Forth standard) barely counts.

The point of the example is not how to get a fast FAXPY on a
mainstream CPU, but how to deal with the many values that are all used
in the loop.

>With my non-standard array/buffer/matrix locals I could define this in
>a one-liner:
>: DAXPY { f: ra M: X Y == Y } ra X mscale Y m+ ;
>\ mscale : vectorized scalar multiply
>\ m+ : vectorized add

The question is: How have you implemented MSCALE and M+? If it's not
in Forth, this indicates that Forth is not up to the task, which one
may consider to be ok, or which one may consider to be a challenge to
make Forth more versatile.

And wrt 1xForth, how would one implement FAXPY or AXPY on machine
Forth for i21?

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

Re: Another example of factoring and locals

<676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:8d5:0:b0:6fa:9835:bac0 with SMTP id 204-20020a3708d5000000b006fa9835bac0mr20884609qki.735.1668036162671;
Wed, 09 Nov 2022 15:22:42 -0800 (PST)
X-Received: by 2002:a81:de43:0:b0:368:ee18:f9c3 with SMTP id
o3-20020a81de43000000b00368ee18f9c3mr57864192ywl.322.1668036162449; Wed, 09
Nov 2022 15:22:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 9 Nov 2022 15:22:42 -0800 (PST)
In-Reply-To: <2022Nov9.225950@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=87.157.106.215; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 87.157.106.215
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<nnd$06f26bb1$30bda3c4@4df1ca99aae48033> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>
<2022Nov9.225950@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Wed, 09 Nov 2022 23:22:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3675
 by: minf...@arcor.de - Wed, 9 Nov 2022 23:22 UTC

Anton Ertl schrieb am Mittwoch, 9. November 2022 um 23:09:30 UTC+1:
> >With my non-standard array/buffer/matrix locals I could define this in
> >a one-liner:
> >: DAXPY { f: ra M: X Y == Y } ra X mscale Y m+ ;
> >\ mscale : vectorized scalar multiply
> >\ m+ : vectorized add
> The question is: How have you implemented MSCALE and M+? If it's not
> in Forth, this indicates that Forth is not up to the task, which one
> may consider to be ok, or which one may consider to be a challenge to
> make Forth more versatile.

Those exemplary vector words could be implemented in slow high-level Forth
but are actually primitives using AVX operators.

But this is besides the point. F.ex. in a scalar imperative language one has to add
matrices in a nested loop (here in C form, Forth would be similar):
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
a[i][j] += b[i][j];
In a language that supports arrays one would just write A = A + B. Nothing
spectacular in many high-level languages.

The challenge had been how to bring this concept into Forth, so that the
code remains embeddable without having to pull in external algebra libraries.

Solution elements:
1) a matrix stack (similar to a dynamic string stack, nothing new)
matrix elements are just fat pointers to the "real" arrays/vectors in heap
2) global matrix values (they have a name)
3) matrix locals (they have names too)
4) some elementary words to operate with a.m. matrices (elementary linear
algebra, some I/O)

From a programmers perspective the most important element of these became
matrix locals. Not because they replaced equivalent matrix stack juggling,
but because they have NAMES!

Algorithms prototyped in MATLAB/SIMULINK can now be "transported"
literally into Forth without reengineering. The syntax only looks like a
postfix Matlab formulation. Finetuning follows in Forth.

I am not selling anything here. But the discussion in this thread whether locals
are evil practice, and that real programmers instead factor longish stack ops
like hell into small digestible chunks is complete BS.

Why? Because locals are means towards higher abstraction and solution orientation!
See my example.

Torturing a stack machine is hidden sadism. ;o)

Re: Another example of factoring and locals

<tkhghh$ja7$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 11:27:30 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkhghh$ja7$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com>
<tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com>
<tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com>
<38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="19783"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 10 Nov 2022 00:27 UTC

On 10/11/2022 4:22 am, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>> On 9/11/2022 8:33 pm, Anton Ertl wrote:
>>> ...
>>> One reason for having locals was for implementing words that
>>> have so many items in constant use that a pure-stack variant is
>>> cumbersome.
>>
>> Both are complicated solutions AFAICS. One has lots of stack
>> operations and the other has lots of variables. They're as bad
>> as each other. Were folks to see that, they might look for
>> another solution.
>
> What would be your solution? Elizabeth Rather suggested assembler,
> and I expect that's what Chuck Moore used before doing his own
> hardware. On i21 he then added A and enhanced R.

Firstly I don't see more variables and variable operations as a
solution. Apparently many do. When 99% of the world of the world's
languages is using variables both to solve its problems and craft
its functions, it's perhaps no surprise forthers will also come to
see them as a solution too - such is the conscious (and unconscious)
bias.

For cherry-picked worst-case examples used to justify locals, if
hand-coded assembler does a better job than either stack or locals,
what's wrong with that?

Re: Another example of factoring and locals

<tkhhrl$vtj$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 11:49:58 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkhhrl$vtj$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org>
<2022Nov9.103332@mips.complang.tuwien.ac.at>
<nnd$06f26bb1$30bda3c4@4df1ca99aae48033>
<e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>
<2022Nov9.225950@mips.complang.tuwien.ac.at>
<676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="32691"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 10 Nov 2022 00:49 UTC

On 10/11/2022 10:22 am, minf...@arcor.de wrote:
> ...
> Torturing a stack machine is hidden sadism. ;o)

Don't do it then. Force-feeding stack machines with locals to produce
a C result, is akin to force-feeding geese to produce “foie gras” :)

Re: Another example of factoring and locals

<f8c0c6ce-a4c3-4382-80db-2a5598fd2dd9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5746:0:b0:39c:deac:c69c with SMTP id 6-20020ac85746000000b0039cdeacc69cmr50612734qtx.292.1668061090120;
Wed, 09 Nov 2022 22:18:10 -0800 (PST)
X-Received: by 2002:a05:6902:100d:b0:6d5:2ee1:ddeb with SMTP id
w13-20020a056902100d00b006d52ee1ddebmr24541097ybt.81.1668061089935; Wed, 09
Nov 2022 22:18:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 9 Nov 2022 22:18:09 -0800 (PST)
In-Reply-To: <tkhghh$ja7$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:746f:e2b1:e5a2:ac2f;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:746f:e2b1:e5a2:ac2f
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <tk722u$1jq1$1@gioia.aioe.org>
<87zgd41up3.fsf@nightsong.com> <tk7sah$1cne$1@gioia.aioe.org>
<87r0yf1ilv.fsf@nightsong.com> <tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com> <38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at> <tkhghh$ja7$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8c0c6ce-a4c3-4382-80db-2a5598fd2dd9n@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Thu, 10 Nov 2022 06:18:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2748
 by: Marcel Hendrix - Thu, 10 Nov 2022 06:18 UTC

On Thursday, November 10, 2022 at 1:27:32 AM UTC+1, dxforth wrote:
[..]
> For cherry-picked worst-case examples used to justify locals, if
> hand-coded assembler does a better job than either stack or locals,
> what's wrong with that?

You need *very* "complicated" matrix-math to have a simple micro do
embedded control of the switched-mode power supplies that are
literally everywhere. One can set about implementing everything in
Forth from scratch, but it will take a single person a decade to get
a debugged library that is good enough to start experimenting
with the real problems at hand. (I am talking from experience).

Now some people may want to take this route, others may prefer
to start with the real problem and work back to the minimum
that is needed in their Forth to get results. In such a case one
wants minf's approach.

In Forth, the problem is that the libraries developed with such
approaches work only on certain machines for certain persons,
and that the certain persons have absolutely no problems with
that.

-marcel

Re: Another example of factoring and locals

<nnd$01dba9ed$2437bd09@7644caf7a65277f9>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com> <2022Nov9.225950@mips.complang.tuwien.ac.at> <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$01dba9ed$2437bd09@7644caf7a65277f9>
Organization: KPN B.V.
Date: Thu, 10 Nov 2022 09:59:48 +0100
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 34
Injection-Date: Thu, 10 Nov 2022 09:59:48 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2164
 by: none - Thu, 10 Nov 2022 08:59 UTC

In article <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>,
<SNIP>
>The challenge had been how to bring this concept into Forth, so that the
>code remains embeddable without having to pull in external algebra libraries.
>
>Solution elements:
>1) a matrix stack (similar to a dynamic string stack, nothing new)
> matrix elements are just fat pointers to the "real" arrays/vectors in heap
>2) global matrix values (they have a name)
>3) matrix locals (they have names too)
>4) some elementary words to operate with a.m. matrices (elementary linear
> algebra, some I/O)

Given that you rarely needs generate matrix in a recursive fashion,
isolation by wordlist is a feasible solution.
Heap beats stack. If I wanted to program in this vein, I surely
wanted to ALLOCATE matrices.
So in fact 2 and 3 require no special measures in a Forth.

>
>From a programmers perspective the most important element of these became
>matrix locals. Not because they replaced equivalent matrix stack juggling,
>but because they have NAMES!

Right.

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: Another example of factoring and locals

<tkifvj$u30$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 20:24:04 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkifvj$u30$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com>
<tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com>
<tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com>
<38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at>
<tkhghh$ja7$1@gioia.aioe.org>
<f8c0c6ce-a4c3-4382-80db-2a5598fd2dd9n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30816"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 10 Nov 2022 09:24 UTC

On 10/11/2022 5:18 pm, Marcel Hendrix wrote:
> On Thursday, November 10, 2022 at 1:27:32 AM UTC+1, dxforth wrote:
> [..]
>> For cherry-picked worst-case examples used to justify locals, if
>> hand-coded assembler does a better job than either stack or locals,
>> what's wrong with that?
>
> You need *very* "complicated" matrix-math to have a simple micro do
> embedded control of the switched-mode power supplies that are
> literally everywhere. One can set about implementing everything in
> Forth from scratch, but it will take a single person a decade to get
> a debugged library that is good enough to start experimenting
> with the real problems at hand. (I am talking from experience).

I'm not aware Moore promised ready-made solutions, or said programmers
would have the capacity to do it themselves. What Standard Forth
promised, I leave to its administration to elucidate.

Re: Another example of factoring and locals

<2022Nov10.183542@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 17:35:42 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 55
Message-ID: <2022Nov10.183542@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <874jvd2ita.fsf@nightsong.com> <tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com> <tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com> <6a1d499d-1cc3-4acb-85dd-24838f93d320n@googlegroups.com> <10839720-ce01-412b-ae79-04d881aace7dn@googlegroups.com> <2022Nov7.232424@mips.complang.tuwien.ac.at> <4b98fe84-2e7a-4f07-b0dd-2342d72057edn@googlegroups.com> <2022Nov8.193506@mips.complang.tuwien.ac.at> <87o7th2qyc.fsf@nightsong.com>
Injection-Info: reader01.eternal-september.org; posting-host="f616614e268247a4ca63e4ad1bc46d26";
logging-data="641931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LFUB+ldRrP7yxpwB/CnOc"
Cancel-Lock: sha1:PYgGPzg88X6YXSD2hgH+9O2U4nc=
X-newsreader: xrn 10.11
 by: Anton Ertl - Thu, 10 Nov 2022 17:35 UTC

Paul Rubin <no.email@nospam.invalid> writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>> if [C.M.'s] old (1971-1978) Forth had been incomprehensible, Forth
>> would not have seen the takeup it has seen. Dean Sanderson would have
>> been unable to design microForth, Seltzer and Ragsdale would have been
>> unable to do fig-Forth, and so on... And I think ... [C.M.]
>> considers the concepts more valuable than the code.
>
>Did Sanderson etc. do their implementations by studying C.M.'s source
>code, or did they simply reimplement its behaviour?

<https://www.forth.com/resources/forth-programming-language/#233_Influences>:
|Although Sanderson worked closely with Moore and shared most of his
|basic philosophies, differences in style and approach were
|inevitable. But the major new influence came from the broader customer
|base that resulted from the wider marketing of microFORTH. It was
|customer pressure that brought back multiprogramming, and this larger
|customer base also caused standards groups to form.

<https://www.forth.com/resources/forth-programming-language/#31_The_Forth_Interest_Group>:
|Ragsdale then looked for someone with the knowledge of microFORTH and
|intimate familiarity with the 6502 to port a version of microFORTH to
|the 6502. He found Maj. Robert Selzer, who had used microFORTH for an
|AMI 6800 development system on an Army project and was privately
|developing a standalone editor/assembler/linker package for the
|6502. Selzer wrote a 6502 Forth assembler, and used the Army’s
|microFORTH metacompiler to target compile the first 6502 stand-alone
|Forth for the Jolt single board computer.
| |Selzer and Ragsdale subsequently made substantial modifications and
|improvements to the model

That's all I know about that topic.

>What I found hard to understand
>was the actual Forth code written by C.M. that I looked at. I also
>found fig-Forth to be hard to understand, if that matters. I'm
>unfamiliar with microForth.

Can you give examples? Both figForth and cmForth have been documented
extensively by C.H. Ting ("System Guide to fig-Forth" and "Footsteps
in an Empty Valley"), but I found I could understand
<https://github.com/ForthHub/cmFORTH/blob/combined/cmforth.fth> for
the most part with just the code and the shadow screens. I have not
looked at fig-Forth for a long time, but looking at it again, it lacks
stack-effect comments, but with knowledge of the stack effects and
some of the principles behind fig-Forth most of the code is quite
understandable to me.

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

Re: Another example of factoring and locals

<2022Nov10.190641@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 18:06:41 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 154
Message-ID: <2022Nov10.190641@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <nnd$06f26bb1$30bda3c4@4df1ca99aae48033> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com> <2022Nov9.225950@mips.complang.tuwien.ac.at> <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>
Injection-Info: reader01.eternal-september.org; posting-host="f616614e268247a4ca63e4ad1bc46d26";
logging-data="646438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uuCQ9hEOphYMS/1yd5w9Y"
Cancel-Lock: sha1:FkfNXdBNwcCg0JbgwulJH+3x+II=
X-newsreader: xrn 10.11
 by: Anton Ertl - Thu, 10 Nov 2022 18:06 UTC

"minf...@arcor.de" <minforth@arcor.de> writes:
>Anton Ertl schrieb am Mittwoch, 9. November 2022 um 23:09:30 UTC+1:
>> >With my non-standard array/buffer/matrix locals I could define this in
>> >a one-liner:
>> >: DAXPY { f: ra M: X Y == Y } ra X mscale Y m+ ;
>> >\ mscale : vectorized scalar multiply
>> >\ m+ : vectorized add
>> The question is: How have you implemented MSCALE and M+? If it's not
>> in Forth, this indicates that Forth is not up to the task, which one
>> may consider to be ok, or which one may consider to be a challenge to
>> make Forth more versatile.
>
>Those exemplary vector words could be implemented in slow high-level Forth
>but are actually primitives using AVX operators.
....
>Solution elements:
>1) a matrix stack (similar to a dynamic string stack, nothing new)
> matrix elements are just fat pointers to the "real" arrays/vectors in heap
>2) global matrix values (they have a name)
>3) matrix locals (they have names too)
>4) some elementary words to operate with a.m. matrices (elementary linear
> algebra, some I/O)

That's somewhat similar to my vector work (see references below and my
incomplete implementation <https://github.com/AntonErtl/vectors>),
except that there are no vector locals (you could have them by using
V! on a cell-sized local buffer), and I am not sure whether your
global matrix corresponds to what I do by V!ing to a variable.

My implementation is based on generating GNU C code for the various
words from Forth, compiling this code and dynamically linking the
result; this code uses the GNU C extension
<https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/using-vector-instructions-through-built-in-functions.html>.
There is also a slow path in standard Forth.

I find this state of affairs unsatisfying. I think that we should be
able to write such code in Forth and get competetive performance.

@InProceedings{ertl17,
author = {M. Anton Ertl},
title = {{SIMD} and Vectors},
crossref = {euroforth17},
pages = {25--36},
url = {http://www.euroforth.org/ef17/papers/ertl.pdf},
video = {https://wiki.forth-ev.de/lib/exe/fetch.php/events:ef2017:simd-vectors.mp4},
OPTnote = {refereed},
abstract = {Many programs have parts with significant data
parallelism, and many CPUs provide SIMD instructions
for processing data-parallel parts faster. The weak
link in this chain is the programming language. We
propose a vector wordset so that Forth programmers
can make use of SIMD instructions to speed up the
data-parallel parts of their applications. The
vector wordset uses a separate vector stack
containing opaque vectors with run-time determined
length. Preliminary results using one benchmark
show a factor~8 speedup of a simple vector
implementation over scalar Gforth code, a smaller
(factor 1.8) speedup over scalar VFX code; another
factor of 3 is possible on this benchmark with a
more sophisticated implementation. However, vectors
have an overhead; this overhead is amortized in this
benchmark at vector lengths between 3 and 250
(depending on which variants we compare).}
}

@Proceedings{euroforth17,
title = {33rd EuroForth Conference},
booktitle = {33rd EuroForth Conference},
year = {2017},
key = {EuroForth'17},
url = {http://www.complang.tuwien.ac.at/anton/euroforth/ef17/papers/proceedings.pdf}
}

@InProceedings{ertl18manlang,
author = {M. Anton Ertl},
title = {Software Vector Chaining},
booktitle = {15th International Conference on Managed Languages &
Runtimes (Manlang'18)},
year = {2018},
pages = {Article-18},
url = {http://www.complang.tuwien.ac.at/papers/ertl18manlang.pdf},
doi = {10.1145/3237009.3237021},
abstract = {Providing vectors of run-time determined length as
opaque value types is a good interface between the
machine-level SIMD instructions and portable
application-oriented programming languages.
Implementing vector operations requires a loop that
breaks the vector into SIMD-register-sized chunks.
A compiler can fuse the loops of several vector
operations together. However, during normal
compilation this is only easy if no other control
structures are involved. This paper explores an
alternative: collect a trace of vector operations at
run-time (following the program control flow during
this collecting step), and then perform the combined
vector loop. This arrangement has a certain
run-time overhead, but its implementation is simpler
and can happen independently, in a library.
Preliminary performance results indicate that the
overhead makes this approach beneficial only for
long vectors ($>1$KB). For shorter vectors, unfused
loops should be used in a library setting.
Fortunately, this choice can be made at run time,
individually for each vector operation.}
}

@InProceedings{ertl18chaining,
author = {M. Anton Ertl},
title = {Software Vector Chaining},
crossref = {euroforth18},
pages = {54-55},
url = {http://www.euroforth.org/ef18/papers/ertl-chaining.pdf},
url-slides = {http://www.euroforth.org/ef18/papers/ertl-chaining-slides.pdf},
video = {https://wiki.forth-ev.de/doku.php/events:ef2018:vectors},
OPTnote = {presentation slides, paper published at Manlang'18},
abstract = {Providing vectors of run-time determined length as
opaque value types is a good interface between the
machine-level SIMD instructions and portable
application-oriented programming languages.
Implementing vector operations requires a loop that
breaks the vector into SIMD-register-sized chunks.
A compiler can fuse the loops of several vector
operations together. However, during normal
compilation this is only easy if no other control
structures are involved. This paper explores an
alternative: collect a trace of vector operations at
run-time (following the program control flow during
this collecting step), and then perform the combined
vector loop. This arrangement has a certain
run-time overhead, but its implementation is simpler
and can happen independently, in a library.
Preliminary performance results indicate that the
overhead makes this approach beneficial only for
long vectors ($>1$KB). For shorter vectors, unfused
loops should be used in a library setting.
Fortunately, this choice can be made at run time,
individually for each vector operation.}
}

@Proceedings{euroforth18,
title = {34th EuroForth Conference},
booktitle = {34th EuroForth Conference},
year = {2018},
key = {EuroForth'18},
url = {http://www.euroforth.org/ef18/papers/proceedings.pdf}
}

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

Re: Another example of factoring and locals

<2022Nov10.193535@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 18:35:35 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 32
Message-ID: <2022Nov10.193535@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <87r0yf1ilv.fsf@nightsong.com> <tkb4qc$1d6b$1@gioia.aioe.org> <4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com> <38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com> <tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at> <tkhghh$ja7$1@gioia.aioe.org>
Injection-Info: reader01.eternal-september.org; posting-host="f616614e268247a4ca63e4ad1bc46d26";
logging-data="646438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SNEjzI0iDHojAWOUlxLZo"
Cancel-Lock: sha1:diPBW84MqjEz45uP0fdfxJIe3Qg=
X-newsreader: xrn 10.11
 by: Anton Ertl - Thu, 10 Nov 2022 18:35 UTC

dxforth <dxforth@gmail.com> writes:
>On 10/11/2022 4:22 am, Anton Ertl wrote:
>> What would be your solution? Elizabeth Rather suggested assembler,
>> and I expect that's what Chuck Moore used before doing his own
>> hardware. On i21 he then added A and enhanced R.
>
>Firstly I don't see more variables and variable operations as a
>solution. Apparently many do. When 99% of the world of the world's
>languages is using variables both to solve its problems and craft
>its functions, it's perhaps no surprise forthers will also come to
>see them as a solution too - such is the conscious (and unconscious)
>bias.

This does not tell me how you would solve the problem.

>For cherry-picked worst-case examples used to justify locals, if
>hand-coded assembler does a better job than either stack or locals,
>what's wrong with that?

It's not Forth. Also, people who reject locals usually claim that a
good Forth programmer can do without them, and typically there are
also claims made that factoring is helpful.

Concerning "cherry-picked example", one example is enough to refute a
general claim.

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

Re: Another example of factoring and locals

<87fseq35ar.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Thu, 10 Nov 2022 12:47:40 -0800
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <87fseq35ar.fsf@nightsong.com>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com>
<tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com>
<tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com>
<38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org>
<2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org>
<2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org>
<2022Nov9.182238@mips.complang.tuwien.ac.at>
<tkhghh$ja7$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="8484876eae9d33473256ae5ecd2c7d39";
logging-data="660154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qz3BHqGwcR98wEkS7JdGX"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:xUDs7PpvzSNbt+tFKtJhu1JZ3bs=
sha1:QpDcE76UyIJWK/xJ8n+KoE6Xjk4=
 by: Paul Rubin - Thu, 10 Nov 2022 20:47 UTC

dxforth <dxforth@gmail.com> writes:
> For cherry-picked worst-case examples used to justify locals, if
> hand-coded assembler does a better job than either stack or locals,
> what's wrong with that?

The worst-case examples are where using pure stack ops causes pain so
excruciating that it stops your work, unless some other approach is
found.

But there are also more numerous non-worst-case examples, where the
stack ops cause only moderate pain that doesn't completely stop the
work. It only distracts from the work and slows it down. This pain is
endurable, but I still don't understand why inviting it on purpose is
not masochism.

Re: Another example of factoring and locals

<7f0a77f2-5483-4083-9569-c750b1f88ddcn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:907:b0:6e2:285e:92ea with SMTP id v7-20020a05620a090700b006e2285e92eamr2340485qkv.213.1668126584847;
Thu, 10 Nov 2022 16:29:44 -0800 (PST)
X-Received: by 2002:a05:6902:100d:b0:6d5:2ee1:ddeb with SMTP id
w13-20020a056902100d00b006d52ee1ddebmr28504296ybt.81.1668126584575; Thu, 10
Nov 2022 16:29:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 10 Nov 2022 16:29:44 -0800 (PST)
In-Reply-To: <2022Nov10.190641@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=87.157.106.215; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 87.157.106.215
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<nnd$06f26bb1$30bda3c4@4df1ca99aae48033> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com>
<2022Nov9.225950@mips.complang.tuwien.ac.at> <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com>
<2022Nov10.190641@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7f0a77f2-5483-4083-9569-c750b1f88ddcn@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Fri, 11 Nov 2022 00:29:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3803
 by: minf...@arcor.de - Fri, 11 Nov 2022 00:29 UTC

Anton Ertl schrieb am Donnerstag, 10. November 2022 um 19:35:00 UTC+1:
> That's somewhat similar to my vector work (see references below and my
> incomplete implementation <https://github.com/AntonErtl/vectors>),
> except that there are no vector locals (you could have them by using
> V! on a cell-sized local buffer), and I am not sure whether your
> global matrix corresponds to what I do by V!ing to a variable.
>
> My implementation is based on generating GNU C code for the various
> words from Forth, compiling this code and dynamically linking the
> result; this code uses the GNU C extension
> <https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/using-vector-instructions-through-built-in-functions.html>.
> There is also a slow path in standard Forth.
>
> I find this state of affairs unsatisfying. I think that we should be
> able to write such code in Forth and get competetive performance.

AFAIU your project it has a more generic approach to map a rather
comprehensive range of SIMD instructions to Forth words that operate
on a stack of vectors with different data types.

My system is much narrower ie. application-oriented. Coding of vector-numeric primitives
is somewhat like described here:
https://www.codeproject.com/Articles/874396/Crunching-Numbers-with-AVX-and-AVX
Vectors in my applications are mostly time series of measured/calculated data.
So the requirements are more special/narrower than generic.

Matrix/vector values and locals occupy just 2 cells: heap memory address plus encoded
data info. Matrices/vectors in heap comprise dimensions, type info, signal tag, etc. pvelus
of course the vector "data string". For instance, vector addition uses the type info
to select the suitable intrinsic instruction. Kind of dumb operator overloading,
but coded within the primitive, without generic Forth words like in your project

As to further developing your vector project, with all due respect, I doubt that this path leads to
more satisfactory results simply because there is way too much variety between CPU
generations and brands (and C compilers). I would leave those SIMD/AVX instructions
in their assembler or bultins/intrinsics world, but you may of course have other ideas
of which I am not aware.

Re: Another example of factoring and locals

<tkk73e$uf2$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Fri, 11 Nov 2022 12:04:46 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkk73e$uf2$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com>
<tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com>
<tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com>
<38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at>
<tkhghh$ja7$1@gioia.aioe.org> <87fseq35ar.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="31202"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 11 Nov 2022 01:04 UTC

On 11/11/2022 7:47 am, Paul Rubin wrote:
> dxforth <dxforth@gmail.com> writes:
>> For cherry-picked worst-case examples used to justify locals, if
>> hand-coded assembler does a better job than either stack or locals,
>> what's wrong with that?
>
> The worst-case examples are where using pure stack ops causes pain so
> excruciating that it stops your work, unless some other approach is
> found.

Pure variable ops cause pain to forthers. What now?

Re: Another example of factoring and locals

<tkkako$1sl1$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Fri, 11 Nov 2022 13:05:13 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkkako$1sl1$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<87r0yf1ilv.fsf@nightsong.com> <tkb4qc$1d6b$1@gioia.aioe.org>
<4d6d0389-1f71-4934-a489-11f5ee2d7574n@googlegroups.com>
<38b67865-7dde-4c69-9abd-8e101af76039n@googlegroups.com>
<tkc82v$1frk$1@gioia.aioe.org> <2022Nov8.193406@mips.complang.tuwien.ac.at>
<tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at>
<tkg4fj$18f$1@gioia.aioe.org> <2022Nov9.182238@mips.complang.tuwien.ac.at>
<tkhghh$ja7$1@gioia.aioe.org> <2022Nov10.193535@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="62113"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 11 Nov 2022 02:05 UTC

On 11/11/2022 5:35 am, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>> On 10/11/2022 4:22 am, Anton Ertl wrote:
>>> What would be your solution? Elizabeth Rather suggested assembler,
>>> and I expect that's what Chuck Moore used before doing his own
>>> hardware. On i21 he then added A and enhanced R.
>>
>> Firstly I don't see more variables and variable operations as a
>> solution. Apparently many do. When 99% of the world of the world's
>> languages is using variables both to solve its problems and craft
>> its functions, it's perhaps no surprise forthers will also come to
>> see them as a solution too - such is the conscious (and unconscious)
>> bias.
>
> This does not tell me how you would solve the problem.

By avoiding them. If my hands are so tied that I can't, I'll go for
the least worst option. AFAIR I've never used locals - at least not
in code written for myself as I consider them lazy and promiscuous.

>> For cherry-picked worst-case examples used to justify locals, if
>> hand-coded assembler does a better job than either stack or locals,
>> what's wrong with that?
>
> It's not Forth.

Since when. ISTR Moore saying something to the effect portability
was a myth.

Re: Another example of factoring and locals

<7wzgcyvszw.fsf@junk.nocrew.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
From: lars.s...@nocrew.org (Lars Brinkhoff)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Organization: nocrew
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<87eduo694u.fsf@nightsong.com>
<02026cae-ed9d-4708-9e42-064868654c91n@googlegroups.com>
<87a65c66u4.fsf@nightsong.com>
<b6d6f67e-d25d-4605-a480-c3c109426092n@googlegroups.com>
<tjq4rc$1h03$1@gioia.aioe.org>
<19093cee-3054-48ed-8d4a-92c97806589cn@googlegroups.com>
<tjra46$gid$1@gioia.aioe.org>
<5a98a33e-8eed-402a-92d5-183705a7f1d4n@googlegroups.com>
<tk26jf$h8o$1@gioia.aioe.org> <87leor2s9i.fsf@nightsong.com>
<tk2fp3$185b$1@gioia.aioe.org> <878rkq2h4l.fsf@nightsong.com>
<tk512n$1s92$1@gioia.aioe.org>
<dcbf4bad-9916-480b-9f9c-71ddd262a409n@googlegroups.com>
<tk5gv2$1thj$1@gioia.aioe.org> <874jvd2ita.fsf@nightsong.com>
<tk722u$1jq1$1@gioia.aioe.org> <87zgd41up3.fsf@nightsong.com>
<tk7sah$1cne$1@gioia.aioe.org> <87r0yf1ilv.fsf@nightsong.com>
Date: Fri, 11 Nov 2022 07:40:35 +0000
Message-ID: <7wzgcyvszw.fsf@junk.nocrew.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:z/Zx9aUx9xv2jfkQkLXxd2mgBxY=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 6
NNTP-Posting-Host: 8c928b30.news.sunsite.dk
X-Trace: 1668152435 news.sunsite.dk 667 lars@junk.nocrew.org/51.15.56.219:42626
X-Complaints-To: staff@sunsite.dk
 by: Lars Brinkhoff - Fri, 11 Nov 2022 07:40 UTC

Paul Rubin wrote:
> Blocks instead of files. I thought this one had resolved some decades
> ago.

I'm using blocks in my day job right now. What do bare metal Forths
with things like flash storage do these days?

Re: Another example of factoring and locals

<1155bad1-7e20-47e4-b7b5-b53c82390b4cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:705:b0:6fa:f91:615c with SMTP id 5-20020a05620a070500b006fa0f91615cmr188630qkc.691.1668153531251;
Thu, 10 Nov 2022 23:58:51 -0800 (PST)
X-Received: by 2002:a25:32d6:0:b0:6cc:35b9:8525 with SMTP id
y205-20020a2532d6000000b006cc35b98525mr768552yby.104.1668153531018; Thu, 10
Nov 2022 23:58:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 10 Nov 2022 23:58:50 -0800 (PST)
In-Reply-To: <7wzgcyvszw.fsf@junk.nocrew.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f14:6b1a:fd3b:650f:e021:be10;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f14:6b1a:fd3b:650f:e021:be10
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <87eduo694u.fsf@nightsong.com>
<02026cae-ed9d-4708-9e42-064868654c91n@googlegroups.com> <87a65c66u4.fsf@nightsong.com>
<b6d6f67e-d25d-4605-a480-c3c109426092n@googlegroups.com> <tjq4rc$1h03$1@gioia.aioe.org>
<19093cee-3054-48ed-8d4a-92c97806589cn@googlegroups.com> <tjra46$gid$1@gioia.aioe.org>
<5a98a33e-8eed-402a-92d5-183705a7f1d4n@googlegroups.com> <tk26jf$h8o$1@gioia.aioe.org>
<87leor2s9i.fsf@nightsong.com> <tk2fp3$185b$1@gioia.aioe.org>
<878rkq2h4l.fsf@nightsong.com> <tk512n$1s92$1@gioia.aioe.org>
<dcbf4bad-9916-480b-9f9c-71ddd262a409n@googlegroups.com> <tk5gv2$1thj$1@gioia.aioe.org>
<874jvd2ita.fsf@nightsong.com> <tk722u$1jq1$1@gioia.aioe.org>
<87zgd41up3.fsf@nightsong.com> <tk7sah$1cne$1@gioia.aioe.org>
<87r0yf1ilv.fsf@nightsong.com> <7wzgcyvszw.fsf@junk.nocrew.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1155bad1-7e20-47e4-b7b5-b53c82390b4cn@googlegroups.com>
Subject: Re: Another example of factoring and locals
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Fri, 11 Nov 2022 07:58:51 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2330
 by: minf...@arcor.de - Fri, 11 Nov 2022 07:58 UTC

Lars Brinkhoff schrieb am Freitag, 11. November 2022 um 08:40:38 UTC+1:
> Paul Rubin wrote:
> > Blocks instead of files. I thought this one had resolved some decades
> > ago.
>
> I'm using blocks in my day job right now. What do bare metal Forths
> with things like flash storage do these days?

Blocks are still viable. Huffman-compressed text takes less storage.

Re: Another example of factoring and locals

<2022Nov11.084133@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Fri, 11 Nov 2022 07:41:33 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 58
Message-ID: <2022Nov11.084133@mips.complang.tuwien.ac.at>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <2022Nov8.193406@mips.complang.tuwien.ac.at> <tkemlq$1t76$1@gioia.aioe.org> <2022Nov9.103332@mips.complang.tuwien.ac.at> <nnd$06f26bb1$30bda3c4@4df1ca99aae48033> <e329cbdf-3823-4a7c-9857-ee6836d50727n@googlegroups.com> <2022Nov9.225950@mips.complang.tuwien.ac.at> <676b958b-5bce-46e0-9dab-bbc9599af1edn@googlegroups.com> <2022Nov10.190641@mips.complang.tuwien.ac.at> <7f0a77f2-5483-4083-9569-c750b1f88ddcn@googlegroups.com>
Injection-Info: reader01.eternal-september.org; posting-host="21eb302516287946c756386fe0c00540";
logging-data="865127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z/0MpNqFIUu9zm1UQFUj/"
Cancel-Lock: sha1:V/LxVD7/ZB54eHZ6MxlomHWPICg=
X-newsreader: xrn 10.11
 by: Anton Ertl - Fri, 11 Nov 2022 07:41 UTC

"minf...@arcor.de" <minforth@arcor.de> writes:
>For instance, vector addition uses the type info
>to select the suitable intrinsic instruction. Kind of dumb operator overloading,
>but coded within the primitive, without generic Forth words like in your project

I think I decided to let the programmer specify the type mainly to
follow Forth tradition, but also to avoid the need to decide what
happens when the programmer wants to mix types. E.g.,

( dfv1 dfv2 ) vdup 0e df>=vs ( dfv1 dfv2 xv ) andv ( dfv1 dfv3 ) df+v ( dfv4 )

When ANDV sees a vector of DFs (64-bit floats) and a vector of Xs
(64-bit integers), what should the result be? I as programmer know
that I want to mask the FP numbers here, but on another occasion I
might want to extract the mantissa fields or somesuch. The most
plausible result is that ANDV produces a bit-vector. When an
overloading +v sees a DF vector and a bit vector, what kind of
addition should it do? With DF+V, it's clear that it should do a DF
addition.

But this issue can be resolved (e.g., by explicitly specifying the
result type of the ANDV), and maybe overloaded operators are
preferable in the end. Normally Forth has few types (cells and
double-cells, sometimes with unsigned variants, characters in memory,
and one float type on the FP stack), while there are 10 different
vector types in my vector wordset; it may be that this is too much
mental load on the programmer and that the Forth system should take
care of that.

>As to further developing your vector project, with all due respect, I doubt that this path leads to
>more satisfactory results simply because there is way too much variety between CPU
>generations and brands (and C compilers). I would leave those SIMD/AVX instructions
>in their assembler or bultins/intrinsics world, but you may of course have other ideas
>of which I am not aware.

It's not sure which path you mean. The current implementation deals
with the variety between architectures by delegating it to gcc. The
difference between CPUs supporting more or fewer instruction set
extensions can be dealt with by compiling for the CPU variety at hand.
Given that the C code is in principle compiled when the vector wordset
is loaded, this could relatively straightforward; in practice the
compiled code is cached, and currently the caching does not take the
CPU variant into account.

In a path I would hope for we provide lower-level SIMD facilities
directly in Forth so that we don't need to defect to C or assembly
language. That path would suffer from the vastness of the SIMD
instruction sets, so it needs a lot of effort, and we may not see
enough interest in that path and its benefits to make this effort.
But in a hypothetical future where Forth occupies the close-to-machine
space that C is retreating from we should be taking this path.

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

Re: Another example of factoring and locals

<nnd$297bd6dd$3f40ec0c@d41a78f6ced5e21e>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <87r0yf1ilv.fsf@nightsong.com> <7wzgcyvszw.fsf@junk.nocrew.org> <1155bad1-7e20-47e4-b7b5-b53c82390b4cn@googlegroups.com>
Subject: Re: Another example of factoring and locals
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$297bd6dd$3f40ec0c@d41a78f6ced5e21e>
Organization: KPN B.V.
Date: Fri, 11 Nov 2022 10:17:37 +0100
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 35
Injection-Date: Fri, 11 Nov 2022 10:17:37 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2357
 by: none - Fri, 11 Nov 2022 09:17 UTC

In article <1155bad1-7e20-47e4-b7b5-b53c82390b4cn@googlegroups.com>,
minf...@arcor.de <minforth@arcor.de> wrote:
>Lars Brinkhoff schrieb am Freitag, 11. November 2022 um 08:40:38 UTC+1:
>> Paul Rubin wrote:
>> > Blocks instead of files. I thought this one had resolved some decades
>> > ago.
>>
>> I'm using blocks in my day job right now. What do bare metal Forths
>> with things like flash storage do these days?
>
>Blocks are still viable. Huffman-compressed text takes less storage.

The way I use blocks is wasting 40%, compared to regular text files, but the
overhead allows the library to be organized as a database of sorts.
It could be compressed to 25% for transporting.
On the other hand, the library don't take a zillion files, and is the
same accross linux apple and MS, and 16/32/64.

250 Kbyte. This include an assembler, floating point, a full screen
editor for MSDOS, compilation and scripting (not in the kernel),
debugging tools, and tools that install on a hard disk, other tools.
Space is not everything.

It is not all that hard to come up with a ISO compatible FILE wordset
in MSP430. Willem Ouwerkerk did it.
I have made a FILE wordset, that uses a tig Gbyte memory stick,
that should work on a OS that handles the USB communication to the stick.

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: Another example of factoring and locals

<nnd$50bc43f4$0ff1299d@ef464df4a0c15fad>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2022Oct26.225153@mips.complang.tuwien.ac.at> <tkhghh$ja7$1@gioia.aioe.org> <2022Nov10.193535@mips.complang.tuwien.ac.at> <tkkako$1sl1$1@gioia.aioe.org>
Subject: Re: Another example of factoring and locals
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$50bc43f4$0ff1299d@ef464df4a0c15fad>
Organization: KPN B.V.
Date: Fri, 11 Nov 2022 10:25:44 +0100
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 25
Injection-Date: Fri, 11 Nov 2022 10:25:44 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1648
 by: none - Fri, 11 Nov 2022 09:25 UTC

In article <tkkako$1sl1$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote:
<SNIP>
>
>Since when. ISTR Moore saying something to the effect portability
>was a myth.

He was wrong. gcc and gforth are portable to an undeniable extent.
Hell, programs written in ciforth are portable across a spectrum
of OSes.

The only point he can possibly contest, is that he don't think it's
worth the effort.

We recently discussed the compiling of pforth. There was a hitch and
it ultimately succeeded. This cannot be compared with writing pforth
from scratch.

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: Another example of factoring and locals

<tkl6u4$tme$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Another example of factoring and locals
Date: Fri, 11 Nov 2022 21:08:03 +1100
Organization: Aioe.org NNTP Server
Message-ID: <tkl6u4$tme$1@gioia.aioe.org>
References: <2022Oct26.225153@mips.complang.tuwien.ac.at>
<tkhghh$ja7$1@gioia.aioe.org> <2022Nov10.193535@mips.complang.tuwien.ac.at>
<tkkako$1sl1$1@gioia.aioe.org> <nnd$50bc43f4$0ff1299d@ef464df4a0c15fad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30414"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Fri, 11 Nov 2022 10:08 UTC

On 11/11/2022 8:25 pm, albert wrote:
> In article <tkkako$1sl1$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote:
> <SNIP>
>>
>> Since when. ISTR Moore saying something to the effect portability
>> was a myth.
>
> He was wrong. gcc and gforth are portable to an undeniable extent.
> Hell, programs written in ciforth are portable across a spectrum
> of OSes.
>
> The only point he can possibly contest, is that he don't think it's
> worth the effort.
>
> We recently discussed the compiling of pforth. There was a hitch and
> it ultimately succeeded. This cannot be compared with writing pforth
> from scratch.

I chased down some references re Moore on portability. Folks can make
of them what they will. It's with good reason he's a thorn to many :)

http://www.ultratechnology.com/antiansi.htm
http://www.ultratechnology.com/levels.htm


devel / comp.lang.forth / Re: Another example of factoring and locals

Pages:123456789
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor