Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and may be fixed. Will keep monitoring.


devel / comp.lang.forth / String processing, for example

SubjectAuthor
* String processing, for exampleAndy Valencia
+- Re: String processing, for examplePaul Rubin
+* Re: String processing, for examplemeff
|`* Re: String processing, for examplePaul Rubin
| `* Re: String processing, for exampleJali Heinonen
|  `- Re: String processing, for exampleRon AARON
+- Re: String processing, for exampleAndy Valencia
+* Re: String processing, for exampleNickolay Kolchin
|`* Re: String processing, for exampleminf...@arcor.de
| `* Re: String processing, for exampleNickolay Kolchin
|  `* Re: String processing, for exampleminf...@arcor.de
|   +* Re: String processing, for exampleNickolay Kolchin
|   |+- Re: String processing, for exampleminf...@arcor.de
|   |`* Re: String processing, for exampleAnton Ertl
|   | `* Re: String processing, for exampleNickolay Kolchin
|   |  +* Re: String processing, for exampleMarcel Hendrix
|   |  |+* Re: String processing, for exampleNickolay Kolchin
|   |  ||`* Re: String processing, for exampleNickolay Kolchin
|   |  || `- Re: String processing, for exampleS Jack
|   |  |`- Re: String processing, for exampledxforth
|   |  `* Re: String processing, for exampleAnton Ertl
|   |   `* Re: String processing, for exampleNickolay Kolchin
|   |    `* Re: String processing, for exampleMarcel Hendrix
|   |     +* Re: String processing, for examplePaul Rubin
|   |     |`- Re: String processing, for exampleMarcel Hendrix
|   |     `- Re: String processing, for exampleminf...@arcor.de
|   `* Re: String processing, for exampleHugh Aguilar
|    `* Re: String processing, for exampleNickolay Kolchin
|     `* Re: String processing, for exampleHugh Aguilar
|      `* Re: String processing, for exampleNickolay Kolchin
|       +* Re: String processing, for examplePaul Rubin
|       |+* Re: String processing, for exampleNickolay Kolchin
|       ||`* Re: String processing, for exampleminf...@arcor.de
|       || +- Re: String processing, for exampleNickolay Kolchin
|       || `* Re: String processing, for exampleHowerd Oakford
|       ||  `- Re: String processing, for exampleminf...@arcor.de
|       |`- Re: String processing, for exampleAnton Ertl
|       `- Re: String processing, for exampleHugh Aguilar
+* Re: String processing, for exampleAnton Ertl
|+* Re: String processing, for exampleNickolay Kolchin
||+* Re: String processing, for exampleMarcel Hendrix
|||`- Re: String processing, for exampleNickolay Kolchin
||`* Re: String processing, for exampleAnton Ertl
|| +* Re: String processing, for exampleMarcel Hendrix
|| |+- Re: String processing, for exampledxforth
|| |+* Re: String processing, for exampleNickolay Kolchin
|| ||`- Re: String processing, for exampleMarcel Hendrix
|| |`* Re: String processing, for exampleAnton Ertl
|| | `- Re: String processing, for exampleRuvim
|| +- Re: String processing, for exampleNickolay Kolchin
|| +* Re: String processing, for exampleStephen Pelc
|| |+- Re: String processing, for exampleHugh Aguilar
|| |`* Re: String processing, for exampleAnton Ertl
|| | `* Re: String processing, for exampleAnton Ertl
|| |  `- Re: String processing, for examplelehs
|| `- Re: String processing, for exampleNickolay Kolchin
|+- Re: String processing, for exampleJan Coombs
|+- Re: String processing, for exampleUlrich Hoffmann
|`* Re: String processing, for exampleAndy Valencia
| +* Re: String processing, for exampleminf...@arcor.de
| |+* Re: String processing, for examplePaul Rubin
| ||`- Re: String processing, for exampleDoug Hoffman
| |`* Re: String processing, for exampleNickolay Kolchin
| | `* Re: String processing, for exampledxforth
| |  `* Re: String processing, for exampleNickolay Kolchin
| |   `- Re: String processing, for exampleS Jack
| +- Re: String processing, for exampleRon AARON
| +- Re: String processing, for exampleAndy Valencia
| +* Re: String processing, for exampledxforth
| |+* Re: String processing, for exampleNickolay Kolchin
| ||`* Re: String processing, for exampledxforth
| || +* Re: String processing, for exampleNickolay Kolchin
| || |`* Re: String processing, for exampleRobert L.
| || | `- Re: String processing, for exampledxforth
| || +* Re: String processing, for exampleMarcel Hendrix
| || |`- Re: String processing, for exampledxforth
| || `- Re: String processing, for exampleS Jack
| |+* Re: String processing, for examplePaul Rubin
| ||+- Re: String processing, for exampledxforth
| ||+- Re: String processing, for exampleAnton Ertl
| ||`* Re: String processing, for exampleMarcel Hendrix
| || `- Re: String processing, for exampleNickolay Kolchin
| |+* Re: String processing, for exampleHugh Aguilar
| ||`- Re: String processing, for exampledxforth
| |`* Re: String processing, for exampleRobert L.
| | `- Re: String processing, for exampledxforth
| +- Re: String processing, for exampleAnton Ertl
| `* Re: String processing, for exampleAndy Valencia
|  +- Re: String processing, for exampleAnton Ertl
|  `* Re: String processing, for exampleAndy Valencia
|   `- Re: String processing, for exampleAnton Ertl
+* Re: String processing, for exampleluser droog
|`* Re: String processing, for exampleAnton Ertl
| `* Re: String processing, for exampleluser droog
|  `- Re: String processing, for exampleAnton Ertl
+* Re: String processing, for exampleHans Bezemer
|`- Re: String processing, for exampleHans Bezemer
+- Re: String processing, for exampleDoug Hoffman
+* Re: String processing, for examplelehs
|`- Re: String processing, for exampledxforth
+* Re: String processing, for exampleRobert L.
+* Re: String processing, for exampleRobert L.
+- Re: String processing, for exampleMark Wills
`* Re: String processing, for examplePaul Rubin

Pages:1234567891011
String processing, for example

<164037894202.1384.9410906461200956517@media.vsta.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: van...@vsta.org (Andy Valencia)
Newsgroups: comp.lang.forth
Subject: String processing, for example
Date: Fri, 24 Dec 2021 12:49:02 -0800
Lines: 35
Message-ID: <164037894202.1384.9410906461200956517@media.vsta.org>
X-Trace: individual.net 19AkqmEg2/g526lmv3cMDwXyGv45U56+eXwh88dIL6GiL3b9Y0
X-Orig-Path: media
Cancel-Lock: sha1:3FA1dMJDM5Zrq1l919nu2BkaZKA=
User-Agent: rn.py v0.0.1
 by: Andy Valencia - Fri, 24 Dec 2021 20:49 UTC

So if you wanted a "descendent of Forth" which fit the hand nicely in the
current compute environment, how about strings? I thought of the toy problem
of counting the number of words in the diction with an "a" in them:

>>> f = open("/usr/share/dict/words", "r")
>>> na = 0
>>> for l in f:
.... if "a" in l:
.... na += 1
....
>>> print na
52849
>>>

(Python, obviously, and it took .13 CPU seconds on an arm64
device, the RockPRO64. The file is 102,401 lines.)

I typed it in just on the fly, no IDE or any dev references needed, and got
it right on the first go--not too surprising.

It could go shorter:

>>> print len([l for l in f if ("a" in l)])
52849
>>>

And--I was surprised--using the same amount of CPU.

Forth as hand written assembly code for a stack machine will never touch
this. I've tried many times to find the language which brings higher level
of expressiveness. Failed every time so far.

Andy Valencia
Home page: https://www.vsta.org/andy/
To contact me: https://www.vsta.org/contact/andy.html

Re: String processing, for example

<877dbtvewh.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Fri, 24 Dec 2021 14:03:58 -0800
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <877dbtvewh.fsf@nightsong.com>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="8de995f55174f5cbf963d7e7843b6741";
logging-data="5383"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PWoHHrQ+sHx/RiAJ6wCCr"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:Kf4PKsSeykX2esvSJ8ShJPFJ5a8=
sha1:VLinMe00yMTFFeQJJ6S7IahQhVA=
 by: Paul Rubin - Fri, 24 Dec 2021 22:03 UTC

Andy Valencia <vandys@vsta.org> writes:
> Forth as hand written assembly code for a stack machine will never touch
> this. I've tried many times to find the language which brings higher level
> of expressiveness. Failed every time so far.

SQL: SELECT COUNT(word) FROM words WHERE word LIKE '%a%';

I used to disdain SQL since lots of times for large datasets, I could
write a much more practical and performant program by using old
fashioned tools like the Un*x sorting utility. Lately I've become a
convert.

Not long ago I wrote a Python script to match up a bunch of urls (that
contained numeric identifiers) with retrieved filenams (that also had
those identifiers). So I had a dictionary mapping urls to id's, and
another dictionary mapping id's to filenames, and IIRC there was another
dictionary that was a reverse mapping. All very standard stuff in
Python. It was a page or so of code, complex enough that I had to fix a
few bugs during testing, but nothing awful. There were a few hundred
filenames involved, not enough for performance or memory consumption to
matter on my laptop.

Then I realized that what I had actually written was a relational JOIN,
so I ripped out my stuff with dictionaries, imported the sqlite3 module,
made an in-memory SQL table, then populated and extracted it with SQL
queries.

That cut the program size in half, made its functionality much more
obvious, and made it simpler to modify (just add ORDER BY to change the
output sorting, etc). But it did that by pulling in a full-blown SQL
implementation. I think that amount of bloat and dependency is counter
to the Forth spirit. I still have to say that it was convenient.

Re: String processing, for example

<sq5hri$p48$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ema...@example.com (meff)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Fri, 24 Dec 2021 22:33:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <sq5hri$p48$1@dont-email.me>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
Injection-Date: Fri, 24 Dec 2021 22:33:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="50ca90c6bd86afe97e322cb727244e79";
logging-data="25736"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+D2Pp2Czk/hgQxGfkWpsVH"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:REpAtBpVRgDoWbBLwRFEb3s3JEk=
 by: meff - Fri, 24 Dec 2021 22:33 UTC

On 2021-12-24, Andy Valencia <vandys@vsta.org> wrote:
> Forth as hand written assembly code for a stack machine will never touch
> this. I've tried many times to find the language which brings higher level
> of expressiveness. Failed every time so far.

Is the question about whether Forth can be expressive enough to implement string
processing? Is the question about whether a fluent Forth programmer can easily
implement something like the one-line Python example? I'm not clear what this
thread is about.

- meff

Re: String processing, for example

<8735mhvcsz.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Fri, 24 Dec 2021 14:49:16 -0800
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <8735mhvcsz.fsf@nightsong.com>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<sq5hri$p48$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="8de995f55174f5cbf963d7e7843b6741";
logging-data="5383"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sGQ8wLhTVQHyo4TiBuLVI"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:j4SLKKimm83mcbNbI2mEfNwmkFY=
sha1:Qz/kra8rLhZtZ/7DPeugmsCnLhw=
 by: Paul Rubin - Fri, 24 Dec 2021 22:49 UTC

meff <email@example.com> writes:
> Is the question about whether Forth can be expressive enough to
> implement string processing? Is the question about whether a fluent
> Forth programmer can easily implement something like the one-line
> Python example?

I think it postulates a hypothetical Forth-descended language that lets
users implement the Python example with comparable ease, and asks what
that Forth-descended language would look like. Forth as we know it
today is much more cumbersome.

We have Oforth, 8th, Factor, and maybe some others as Forth-descended
languages that might fit the bill. These all have their aficionados.
I'm personally not that enthused about any of them, since the Forth
features they preserve (RPN and visible stacks) are imho not that
helpful once the language implementation is that complicated. But
that's just me.

For an article on a distantly comparable situation with Lisp, see:

http://www.cs.kent.ac.uk/people/staff/dat/miranda/wadler87.pdf

Re: String processing, for example

<164039180411.5919.17810620462526744057@media.vsta.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: van...@vsta.org (Andy Valencia)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Fri, 24 Dec 2021 16:23:24 -0800
Lines: 14
Message-ID: <164039180411.5919.17810620462526744057@media.vsta.org>
References: <877dbtvewh.fsf@nightsong.com> <164037894202.1384.9410906461200956517@media.vsta.org>
X-Trace: individual.net Oo4VYlx/SwHEKpjeb3/WQQnEMG5tuyOFrGtAs/uuHpDMT1P/2X
X-Orig-Path: media
Cancel-Lock: sha1:imbKpaI6MxZVArA6SL0MXy4VqTg=
User-Agent: rn.py v0.0.1
 by: Andy Valencia - Sat, 25 Dec 2021 00:23 UTC

Paul Rubin <no.email@nospam.invalid> writes:
> (solve w. SQL)
> That cut the program size in half, made its functionality much more
> obvious, and made it simpler to modify (just add ORDER BY to change the
> output sorting, etc). But it did that by pulling in a full-blown SQL
> implementation. I think that amount of bloat and dependency is counter
> to the Forth spirit. I still have to say that it was convenient.

And I have to say, I've used sqlite3 many, many times. It's not svelte, but
in bang/buck for database functionality, it's the best bargain going.

Andy Valencia
Home page: https://www.vsta.org/andy/
To contact me: https://www.vsta.org/contact/andy.html

Re: String processing, for example

<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4495:: with SMTP id x21mr6432673qkp.604.1640407751956;
Fri, 24 Dec 2021 20:49:11 -0800 (PST)
X-Received: by 2002:ac8:5a54:: with SMTP id o20mr7826531qta.480.1640407751719;
Fri, 24 Dec 2021 20:49:11 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 24 Dec 2021 20:49:11 -0800 (PST)
In-Reply-To: <164037894202.1384.9410906461200956517@media.vsta.org>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sat, 25 Dec 2021 04:49:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 38
 by: Nickolay Kolchin - Sat, 25 Dec 2021 04:49 UTC

On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> So if you wanted a "descendent of Forth" which fit the hand nicely in the
> current compute environment, how about strings? I thought of the toy problem
> of counting the number of words in the diction with an "a" in them:
>
> >>> f = open("/usr/share/dict/words", "r")
> >>> na = 0
> >>> for l in f:
> ... if "a" in l:
> ... na += 1
> ...
> >>> print na
> 52849
> >>>
>
> (Python, obviously, and it took .13 CPU seconds on an arm64
> device, the RockPRO64. The file is 102,401 lines.)
>
> I typed it in just on the fly, no IDE or any dev references needed, and got
> it right on the first go--not too surprising.
>
> It could go shorter:
>
> >>> print len([l for l in f if ("a" in l)])
> 52849
> >>>
>
> And--I was surprised--using the same amount of CPU.
>
> Forth as hand written assembly code for a stack machine will never touch
> this. I've tried many times to find the language which brings higher level
> of expressiveness. Failed every time so far.
>

Factor variant:

0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each

Probably, this can be written shorter, but I'm not familiar with Factor enough.

Re: String processing, for example

<63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:2aaa:: with SMTP id js10mr5523231qvb.38.1640428089454;
Sat, 25 Dec 2021 02:28:09 -0800 (PST)
X-Received: by 2002:a05:620a:4691:: with SMTP id bq17mr6956611qkb.510.1640428089314;
Sat, 25 Dec 2021 02:28:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 02:28:09 -0800 (PST)
In-Reply-To: <bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f26:2c53:ddf9:54e1:3f10:7e6c;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f26:2c53:ddf9:54e1:3f10:7e6c
References: <164037894202.1384.9410906461200956517@media.vsta.org> <bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
Subject: Re: String processing, for example
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 25 Dec 2021 10:28:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 42
 by: minf...@arcor.de - Sat, 25 Dec 2021 10:28 UTC

Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 05:49:12 UTC+1:
> On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> > So if you wanted a "descendent of Forth" which fit the hand nicely in the
> > current compute environment, how about strings? I thought of the toy problem
> > of counting the number of words in the diction with an "a" in them:
> >
> > >>> f = open("/usr/share/dict/words", "r")
> > >>> na = 0
> > >>> for l in f:
> > ... if "a" in l:
> > ... na += 1
> > ...
> > >>> print na
> > 52849
> > >>>
> >
> > (Python, obviously, and it took .13 CPU seconds on an arm64
> > device, the RockPRO64. The file is 102,401 lines.)
> >
> > I typed it in just on the fly, no IDE or any dev references needed, and got
> > it right on the first go--not too surprising.
> >
> > It could go shorter:
> >
> > >>> print len([l for l in f if ("a" in l)])
> > 52849
> > >>>
> >
> > And--I was surprised--using the same amount of CPU.
> >
> > Forth as hand written assembly code for a stack machine will never touch
> > this. I've tried many times to find the language which brings higher level
> > of expressiveness. Failed every time so far.
> >
> Factor variant:
>
> 0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each
>
> Probably, this can be written shorter, but I'm not familiar with Factor enough.

That's what had me always kept away from Factor: you have to read it forward
and backwards. Your eyes always have to 'go zig-zag' to read Factor code.
I find its syntax annoying and tiring.

Re: String processing, for example

<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:430e:: with SMTP id u14mr6962625qko.286.1640429119030;
Sat, 25 Dec 2021 02:45:19 -0800 (PST)
X-Received: by 2002:a05:6214:d61:: with SMTP id 1mr8621485qvs.125.1640429118793;
Sat, 25 Dec 2021 02:45:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 02:45:18 -0800 (PST)
In-Reply-To: <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sat, 25 Dec 2021 10:45:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 48
 by: Nickolay Kolchin - Sat, 25 Dec 2021 10:45 UTC

On Saturday, December 25, 2021 at 1:28:10 PM UTC+3, minf...@arcor.de wrote:
> Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 05:49:12 UTC+1:
> > On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> > > So if you wanted a "descendent of Forth" which fit the hand nicely in the
> > > current compute environment, how about strings? I thought of the toy problem
> > > of counting the number of words in the diction with an "a" in them:
> > >
> > > >>> f = open("/usr/share/dict/words", "r")
> > > >>> na = 0
> > > >>> for l in f:
> > > ... if "a" in l:
> > > ... na += 1
> > > ...
> > > >>> print na
> > > 52849
> > > >>>
> > >
> > > (Python, obviously, and it took .13 CPU seconds on an arm64
> > > device, the RockPRO64. The file is 102,401 lines.)
> > >
> > > I typed it in just on the fly, no IDE or any dev references needed, and got
> > > it right on the first go--not too surprising.
> > >
> > > It could go shorter:
> > >
> > > >>> print len([l for l in f if ("a" in l)])
> > > 52849
> > > >>>
> > >
> > > And--I was surprised--using the same amount of CPU.
> > >
> > > Forth as hand written assembly code for a stack machine will never touch
> > > this. I've tried many times to find the language which brings higher level
> > > of expressiveness. Failed every time so far.
> > >
> > Factor variant:
> >
> > 0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each
> >
> > Probably, this can be written shorter, but I'm not familiar with Factor enough.
> That's what had me always kept away from Factor: you have to read it forward
> and backwards. Your eyes always have to 'go zig-zag' to read Factor code.
> I find its syntax annoying and tiring.

Yes, I've also noticed that. Maybe it is possible to get used to it after some time,
just like with Forth RPN.

But the very concept of combinators is noteworthy and should be borrowed.
Sometimes they allow you to avoid complicated manipulations with the stack.

Re: String processing, for example

<2021Dec25.105035@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Sat, 25 Dec 2021 09:50:35 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 153
Message-ID: <2021Dec25.105035@mips.complang.tuwien.ac.at>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
Injection-Info: reader02.eternal-september.org; posting-host="70510cc33546f9e44e24374914364b6e";
logging-data="2908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UeMYsJPSm32fh/XirogNC"
Cancel-Lock: sha1:oYgL8ya6UYzu3nzLLQ+k2faRX7w=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sat, 25 Dec 2021 09:50 UTC

Andy Valencia <vandys@vsta.org> writes:
>So if you wanted a "descendent of Forth" which fit the hand nicely in the
>current compute environment, how about strings? I thought of the toy problem
>of counting the number of words in the diction with an "a" in them:
>
>>>> f = open("/usr/share/dict/words", "r")
>>>> na = 0
>>>> for l in f:
>... if "a" in l:
>... na += 1
>...
>>>> print na
>52849
>>>>
>
>(Python, obviously, and it took .13 CPU seconds on an arm64
>device, the RockPRO64. The file is 102,401 lines.)

We don't have /usr/share/dict/words on our Rockpro 64 (nor on the two
other systems I checked). Looking around for it, I did not find it,
but found a pointer to
<http://downloads.sourceforge.net/project/wordlist/SCOWL/2020.12.07/scowl-2020.12.07.tar.gz>

I don't see anything with 102401 lines there, so instead I used
final/english-words.80, which has 139209 lines.

Let's see how this works out (I have disabled the slow cores to get
more reliable timings):

[rockpro64:/tmp/scowl-2020.12.07:76145] time python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("final/english-words.80","r")
>>> print len([l for l in f if ("a" in l)])
78886
>>>

real 0m23.269s
user 0m0.136s
sys 0m0.024s

Ok, but Python 2 is no longer supported, so let's try Python 3:

[rockpro64:/tmp/scowl-2020.12.07:76146] time python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("final/english-words.80","r")
>>> print len([l for l in f if ("a" in l)])
File "<stdin>", line 1
print len([l for l in f if ("a" in l)])
^
SyntaxError: invalid syntax

Ok, so fall back to your first variant:

>>> na = 0
>>> for l in f:
.... if "a" in l:
.... na += 1
....
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 2797: invalid continuation byte

Great going, Python!

What would I use for this task?

[rockpro64:/tmp/scowl-2020.12.07:76147] time sh -c "grep a final/english-words.80|wc -l"
78683

real 0m0.092s
user 0m0.048s
sys 0m0.032s

Quite a bit shorter and faster than your short Python 2 version, but
with a different result. Investigation reveals that GNU grep 2.27
apparently silently does not output lines that contain Latin-1
characters when LANG=C.UTF-8, which is even worse than Python 3's
behaviour. This can be fixed with

[rockpro64:/tmp/scowl-2020.12.07:76148] time env LANG=C sh -c "grep a final/english-words.80|wc -l"
78886

real 0m0.077s
user 0m0.064s
sys 0m0.008s

but I guess that the same fix may help Python 3.

Anyway, let's see about Forth:

[rockpro64:/tmp/scowl-2020.12.07:76149] time ~/nfstmp/gforth-arm64/gforth -e "s\" final/english-words.80\" slurp-file :noname 0 >r begin 'a' scan dup while r> 1+ >r #lf scan dup 0= until then 2drop r> ; execute . bye"
78886
real 0m0.105s
user 0m0.044s
sys 0m0.032s

On my first try I forgot the second DUP, but the bug and its fix was
obvious once I saw the stack underflow error message and it worked on
the second try. For this code, gforth is faster than gforth-fast,
because gforth-fast has more startup overhead (especially on Aarch64),
and much of the time is spent in SCAN (which does not benefit much
from the differences between gforth and gforth-fast).

The layout of the program is not so nice in this command-line form, so
here it's with nicer layout:

s" final/english-words.80" slurp-file
:noname
0 >r begin
'a' scan dup while
r> 1+ >r
#lf scan dup 0= until then
2drop r> ;
execute .

Longer than the two python variants, but not by much. Looking at it
again, I would now code it as:

: counts
0 >r begin
'a' scan dup while
r> 1+ >r
#lf scan dup 0= until then
2drop r> ;
s" final/english-words.80" slurp-file counts .

>Forth as hand written assembly code for a stack machine will never touch
>this.

It's not there, but it's close. And concerning compatibility: 'a' did
not work on Gforth 0.6, but 'a did and still does, so by changing the
'a' into 'a, you are compatible back from 0.6 (2003) to the current
development version. SLURP-FILE did not work on Gforth 0.5 (2000), so
to be compatible with that more work would be needed.

>I've tried many times to find the language which brings higher level
>of expressiveness. Failed every time so far.

The Unix shell combined with the shell tools are the language of
choice for this kind of task, as demonstrated here again.

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

Re: String processing, for example

<3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:21e3:: with SMTP id p3mr8797538qvj.116.1640431522172;
Sat, 25 Dec 2021 03:25:22 -0800 (PST)
X-Received: by 2002:a37:aac6:: with SMTP id t189mr6958256qke.327.1640431522023;
Sat, 25 Dec 2021 03:25:22 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 03:25:21 -0800 (PST)
In-Reply-To: <76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f26:2c53:ddf9:54e1:3f10:7e6c;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f26:2c53:ddf9:54e1:3f10:7e6c
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
Subject: Re: String processing, for example
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 25 Dec 2021 11:25:22 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 52
 by: minf...@arcor.de - Sat, 25 Dec 2021 11:25 UTC

Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 11:45:19 UTC+1:
> On Saturday, December 25, 2021 at 1:28:10 PM UTC+3, minf...@arcor.de wrote:
> > Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 05:49:12 UTC+1:
> > > On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> > > > So if you wanted a "descendent of Forth" which fit the hand nicely in the
> > > > current compute environment, how about strings? I thought of the toy problem
> > > > of counting the number of words in the diction with an "a" in them:
> > > >
> > > > >>> f = open("/usr/share/dict/words", "r")
> > > > >>> na = 0
> > > > >>> for l in f:
> > > > ... if "a" in l:
> > > > ... na += 1
> > > > ...
> > > > >>> print na
> > > > 52849
> > > > >>>
> > > >
> > > > (Python, obviously, and it took .13 CPU seconds on an arm64
> > > > device, the RockPRO64. The file is 102,401 lines.)
> > > >
> > > > I typed it in just on the fly, no IDE or any dev references needed, and got
> > > > it right on the first go--not too surprising.
> > > >
> > > > It could go shorter:
> > > >
> > > > >>> print len([l for l in f if ("a" in l)])
> > > > 52849
> > > > >>>
> > > >
> > > > And--I was surprised--using the same amount of CPU.
> > > >
> > > > Forth as hand written assembly code for a stack machine will never touch
> > > > this. I've tried many times to find the language which brings higher level
> > > > of expressiveness. Failed every time so far.
> > > >
> > > Factor variant:
> > >
> > > 0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each
> > >
> > > Probably, this can be written shorter, but I'm not familiar with Factor enough.
> > That's what had me always kept away from Factor: you have to read it forward
> > and backwards. Your eyes always have to 'go zig-zag' to read Factor code.
> > I find its syntax annoying and tiring.
> Yes, I've also noticed that. Maybe it is possible to get used to it after some time,
> just like with Forth RPN.
>
> But the very concept of combinators is noteworthy and should be borrowed.
> Sometimes they allow you to avoid complicated manipulations with the stack.

Once you have quotations in your Forth, eg
https://www.complang.tuwien.ac.at/forth/ansforth-cvs/quotations.txt
combinators shouldn't be too difficult to implement.

Re: String processing, for example

<3f1edc15-7cac-4026-8049-a718ccc98770n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5c45:: with SMTP id j5mr8547586qtj.58.1640433096454;
Sat, 25 Dec 2021 03:51:36 -0800 (PST)
X-Received: by 2002:a05:6214:202f:: with SMTP id 15mr8827535qvf.37.1640433096181;
Sat, 25 Dec 2021 03:51:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 03:51:36 -0800 (PST)
In-Reply-To: <2021Dec25.105035@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org> <2021Dec25.105035@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f1edc15-7cac-4026-8049-a718ccc98770n@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sat, 25 Dec 2021 11:51:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 221
 by: Nickolay Kolchin - Sat, 25 Dec 2021 11:51 UTC

On Saturday, December 25, 2021 at 2:06:38 PM UTC+3, Anton Ertl wrote:
> Andy Valencia <van...@vsta.org> writes:
> >So if you wanted a "descendent of Forth" which fit the hand nicely in the
> >current compute environment, how about strings? I thought of the toy problem
> >of counting the number of words in the diction with an "a" in them:
> >
> >>>> f = open("/usr/share/dict/words", "r")
> >>>> na = 0
> >>>> for l in f:
> >... if "a" in l:
> >... na += 1
> >...
> >>>> print na
> >52849
> >>>>
> >
> >(Python, obviously, and it took .13 CPU seconds on an arm64
> >device, the RockPRO64. The file is 102,401 lines.)
> We don't have /usr/share/dict/words on our Rockpro 64 (nor on the two
> other systems I checked). Looking around for it, I did not find it,
> but found a pointer to
> <http://downloads.sourceforge.net/project/wordlist/SCOWL/2020.12.07/scowl-2020.12.07.tar.gz>
>
> I don't see anything with 102401 lines there, so instead I used
> final/english-words.80, which has 139209 lines.
>
> Let's see how this works out (I have disabled the slow cores to get
> more reliable timings):
>
> [rockpro64:/tmp/scowl-2020.12.07:76145] time python
> Python 2.7.13 (default, Sep 26 2018, 18:42:22)
> [GCC 6.3.0 20170516] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> f = open("final/english-words.80","r")
> >>> print len([l for l in f if ("a" in l)])
> 78886
> >>>
>
> real 0m23.269s
> user 0m0.136s
> sys 0m0.024s
>
> Ok, but Python 2 is no longer supported, so let's try Python 3:
>
> [rockpro64:/tmp/scowl-2020.12.07:76146] time python3
> Python 3.5.3 (default, Sep 27 2018, 17:25:39)
> [GCC 6.3.0 20170516] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> f = open("final/english-words.80","r")
> >>> print len([l for l in f if ("a" in l)])
> File "<stdin>", line 1
> print len([l for l in f if ("a" in l)])
> ^
> SyntaxError: invalid syntax
>
> Ok, so fall back to your first variant:
> >>> na = 0
> >>> for l in f:
> ... if "a" in l:
> ... na += 1
> ...
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/lib/python3.5/codecs.py", line 321, in decode
> (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 2797: invalid continuation byte
>
> Great going, Python!
>
> What would I use for this task?
>
> [rockpro64:/tmp/scowl-2020.12.07:76147] time sh -c "grep a final/english-words.80|wc -l"
> 78683
>
> real 0m0.092s
> user 0m0.048s
> sys 0m0.032s
>
> Quite a bit shorter and faster than your short Python 2 version, but
> with a different result. Investigation reveals that GNU grep 2.27
> apparently silently does not output lines that contain Latin-1
> characters when LANG=C.UTF-8, which is even worse than Python 3's
> behaviour. This can be fixed with
>
> [rockpro64:/tmp/scowl-2020.12.07:76148] time env LANG=C sh -c "grep a final/english-words.80|wc -l"
> 78886
>
> real 0m0.077s
> user 0m0.064s
> sys 0m0.008s
>
> but I guess that the same fix may help Python 3.
>
> Anyway, let's see about Forth:
>
> [rockpro64:/tmp/scowl-2020.12.07:76149] time ~/nfstmp/gforth-arm64/gforth -e "s\" final/english-words.80\" slurp-file :noname 0 >r begin 'a' scan dup while r> 1+ >r #lf scan dup 0= until then 2drop r> ; execute . bye"
> 78886
> real 0m0.105s
> user 0m0.044s
> sys 0m0.032s
>
> On my first try I forgot the second DUP, but the bug and its fix was
> obvious once I saw the stack underflow error message and it worked on
> the second try. For this code, gforth is faster than gforth-fast,
> because gforth-fast has more startup overhead (especially on Aarch64),
> and much of the time is spent in SCAN (which does not benefit much
> from the differences between gforth and gforth-fast).
>
> The layout of the program is not so nice in this command-line form, so
> here it's with nicer layout:
>
> s" final/english-words.80" slurp-file
> :noname
> 0 >r begin
> 'a' scan dup while
> r> 1+ >r
> #lf scan dup 0= until then
> 2drop r> ;
> execute .
>
> Longer than the two python variants, but not by much. Looking at it
> again, I would now code it as:
>
> : counts
> 0 >r begin
> 'a' scan dup while
> r> 1+ >r
> #lf scan dup 0= until then
> 2drop r> ;
> s" final/english-words.80" slurp-file counts .
> >Forth as hand written assembly code for a stack machine will never touch
> >this.
> It's not there, but it's close. And concerning compatibility: 'a' did
> not work on Gforth 0.6, but 'a did and still does, so by changing the
> 'a' into 'a, you are compatible back from 0.6 (2003) to the current
> development version. SLURP-FILE did not work on Gforth 0.5 (2000), so
> to be compatible with that more work would be needed.

What a great example.

So, i've tried to run it on various forths:

: counts
0 >r begin
'a' scan dup while
r> 1+ >r
#lf scan dup 0 until then
2drop r>
;

: main-ertl s" /usr/share/dict/words" slurp-file counts . ;

$ lxf include ertl.fth

evaluate: include ertl.fth col: 16
ertl.fth line: 7 col: 8
undefined word #lf
no block file

No luck with LXF. Probably it is not standard conformant enough.

$ sf ertl.fth
/some/path/ertl.fth
8: #lf scan dup 0= >>> #lf ?
Exit? (Yes/No/Edit)

No luck with SwiftForth.

$ vfxlin32 include ertl.fth
VFX Forth 5.20 [build 0749] 2021-05-27 for Linux x86
© MicroProcessor Engineering Ltd, 1998-2021

Including ertl.fth
Err# -13 ERR: Undefined word.
Source: "ertl.fth" on line 8
-> #lf scan dup 0 ^
ERROR on command line

Vfx also refuses to compile this code.

$ i4 include /some/path/ertl.fth
....
Thrown out of `/some/path/ertl.fth'
Error -13 in line #8 at nesting level 1
#lf scan dup 0-------^
#lf ?

iForth also refuses to build it.

Well, we also have Forth2012 compatible IKForth

$ ikforth -f ertl.fth
....
Undefined word #lf
at '(TRACKED-INCLUDED)' (H# 2000D89C)
LINE# H# 00000008 #lf scan dup 0
No, luck.

But this should be smth simple. Probably #lf is just 10. Let's define it and
check.

[undefined] #lf [if] 10 CONSTANT #lf [then]

But it still doesn't compile on any of them...

It is fun to see how core "Standards Team Member" uses THREE non-standard words
in a simple example.

Re: String processing, for example

<5adeb0de-0b0d-462d-9e64-26a4f0eb3b2dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4495:: with SMTP id x21mr7053854qkp.604.1640435752641;
Sat, 25 Dec 2021 04:35:52 -0800 (PST)
X-Received: by 2002:a05:620a:4087:: with SMTP id f7mr7183589qko.56.1640435752284;
Sat, 25 Dec 2021 04:35:52 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 04:35:52 -0800 (PST)
In-Reply-To: <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5adeb0de-0b0d-462d-9e64-26a4f0eb3b2dn@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sat, 25 Dec 2021 12:35:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 64
 by: Nickolay Kolchin - Sat, 25 Dec 2021 12:35 UTC

On Saturday, December 25, 2021 at 2:25:22 PM UTC+3, minf...@arcor.de wrote:
> Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 11:45:19 UTC+1:
> > On Saturday, December 25, 2021 at 1:28:10 PM UTC+3, minf...@arcor.de wrote:
> > > Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 05:49:12 UTC+1:
> > > > On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> > > > > So if you wanted a "descendent of Forth" which fit the hand nicely in the
> > > > > current compute environment, how about strings? I thought of the toy problem
> > > > > of counting the number of words in the diction with an "a" in them:
> > > > >
> > > > > >>> f = open("/usr/share/dict/words", "r")
> > > > > >>> na = 0
> > > > > >>> for l in f:
> > > > > ... if "a" in l:
> > > > > ... na += 1
> > > > > ...
> > > > > >>> print na
> > > > > 52849
> > > > > >>>
> > > > >
> > > > > (Python, obviously, and it took .13 CPU seconds on an arm64
> > > > > device, the RockPRO64. The file is 102,401 lines.)
> > > > >
> > > > > I typed it in just on the fly, no IDE or any dev references needed, and got
> > > > > it right on the first go--not too surprising.
> > > > >
> > > > > It could go shorter:
> > > > >
> > > > > >>> print len([l for l in f if ("a" in l)])
> > > > > 52849
> > > > > >>>
> > > > >
> > > > > And--I was surprised--using the same amount of CPU.
> > > > >
> > > > > Forth as hand written assembly code for a stack machine will never touch
> > > > > this. I've tried many times to find the language which brings higher level
> > > > > of expressiveness. Failed every time so far.
> > > > >
> > > > Factor variant:
> > > >
> > > > 0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each
> > > >
> > > > Probably, this can be written shorter, but I'm not familiar with Factor enough.
> > > That's what had me always kept away from Factor: you have to read it forward
> > > and backwards. Your eyes always have to 'go zig-zag' to read Factor code.
> > > I find its syntax annoying and tiring.
> > Yes, I've also noticed that. Maybe it is possible to get used to it after some time,
> > just like with Forth RPN.
> >
> > But the very concept of combinators is noteworthy and should be borrowed.
> > Sometimes they allow you to avoid complicated manipulations with the stack.
> Once you have quotations in your Forth, eg
> https://www.complang.tuwien.ac.at/forth/ansforth-cvs/quotations.txt
> combinators shouldn't be too difficult to implement.

This is a bit more complex. In Forth quotations are just :NONAME inside colon
definition. I.e. they are compiled and there is no way except MARKER to remove
them. In Factor (AFAIK) they are garbage collected.

This prevents us from using RTCG in Forth. Eventually we will run out of
memory. Consider this example.

: GEN [: POSTPONE LIT ;] ; \ simple demo
: TTT 0 0 1000000 DO I GEN EXECUTE + LOOP ;
TTT

Re: String processing, for example

<ab4513b6-08d6-441d-9251-9d1d7121dc1an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1112:: with SMTP id e18mr8746110qty.226.1640438188735;
Sat, 25 Dec 2021 05:16:28 -0800 (PST)
X-Received: by 2002:ae9:f708:: with SMTP id s8mr6374642qkg.306.1640438188564;
Sat, 25 Dec 2021 05:16:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 05:16:28 -0800 (PST)
In-Reply-To: <5adeb0de-0b0d-462d-9e64-26a4f0eb3b2dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=79.224.104.34; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 79.224.104.34
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<5adeb0de-0b0d-462d-9e64-26a4f0eb3b2dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ab4513b6-08d6-441d-9251-9d1d7121dc1an@googlegroups.com>
Subject: Re: String processing, for example
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 25 Dec 2021 13:16:28 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 79
 by: minf...@arcor.de - Sat, 25 Dec 2021 13:16 UTC

Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 13:35:53 UTC+1:
> On Saturday, December 25, 2021 at 2:25:22 PM UTC+3, minf...@arcor.de wrote:
> > Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 11:45:19 UTC+1:
> > > On Saturday, December 25, 2021 at 1:28:10 PM UTC+3, minf...@arcor.de wrote:
> > > > Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 05:49:12 UTC+1:
> > > > > On Saturday, December 25, 2021 at 12:01:50 AM UTC+3, Andy Valencia wrote:
> > > > > > So if you wanted a "descendent of Forth" which fit the hand nicely in the
> > > > > > current compute environment, how about strings? I thought of the toy problem
> > > > > > of counting the number of words in the diction with an "a" in them:
> > > > > >
> > > > > > >>> f = open("/usr/share/dict/words", "r")
> > > > > > >>> na = 0
> > > > > > >>> for l in f:
> > > > > > ... if "a" in l:
> > > > > > ... na += 1
> > > > > > ...
> > > > > > >>> print na
> > > > > > 52849
> > > > > > >>>
> > > > > >
> > > > > > (Python, obviously, and it took .13 CPU seconds on an arm64
> > > > > > device, the RockPRO64. The file is 102,401 lines.)
> > > > > >
> > > > > > I typed it in just on the fly, no IDE or any dev references needed, and got
> > > > > > it right on the first go--not too surprising.
> > > > > >
> > > > > > It could go shorter:
> > > > > >
> > > > > > >>> print len([l for l in f if ("a" in l)])
> > > > > > 52849
> > > > > > >>>
> > > > > >
> > > > > > And--I was surprised--using the same amount of CPU.
> > > > > >
> > > > > > Forth as hand written assembly code for a stack machine will never touch
> > > > > > this. I've tried many times to find the language which brings higher level
> > > > > > of expressiveness. Failed every time so far.
> > > > > >
> > > > > Factor variant:
> > > > >
> > > > > 0 "/usr/share/dict/words" utf8 file-lines [ CHAR: a swap index [ 1 + ] [ ] if ] each
> > > > >
> > > > > Probably, this can be written shorter, but I'm not familiar with Factor enough.
> > > > That's what had me always kept away from Factor: you have to read it forward
> > > > and backwards. Your eyes always have to 'go zig-zag' to read Factor code.
> > > > I find its syntax annoying and tiring.
> > > Yes, I've also noticed that. Maybe it is possible to get used to it after some time,
> > > just like with Forth RPN.
> > >
> > > But the very concept of combinators is noteworthy and should be borrowed.
> > > Sometimes they allow you to avoid complicated manipulations with the stack.
> > Once you have quotations in your Forth, eg
> > https://www.complang.tuwien.ac.at/forth/ansforth-cvs/quotations.txt
> > combinators shouldn't be too difficult to implement.
> This is a bit more complex. In Forth quotations are just :NONAME inside colon
> definition. I.e. they are compiled and there is no way except MARKER to remove
> them. In Factor (AFAIK) they are garbage collected.
>
> This prevents us from using RTCG in Forth. Eventually we will run out of
> memory. Consider this example.
>
> : GEN [: POSTPONE LIT ;] ; \ simple demo
> : TTT 0 0 1000000 DO I GEN EXECUTE + LOOP ;
> TTT

I think I get your meaning, although IMHO your demo just does what it had been told
namely compile an excessive number of literals.

I don't know Factor well enough, but contrary to Forth all data (including numbers)
reside in the heap. The stack just contains pointers to data items, which then can be
all kinds of data including code lists = quotations. At least that's how I understand
it (which might be wrong).

Consequently DROP in addition to decrement the stack point has to free assigned data.
ABORT/THROW et cetera have to walk the stack to free all assigned data when needed.
So it's a stack-based garbage collection. MARKER would have to free other data of course,
like VALUES and VARIABLEs (don't know if they exist in Factor).

BTW I use a similar mechanism in my own Linear Algebra package in Forth.

Re: String processing, for example

<20211225134639.62cafe9d@t530>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jan4comp...@murray-microft.co.uk (Jan Coombs)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Sat, 25 Dec 2021 13:46:39 +0000
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <20211225134639.62cafe9d@t530>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<2021Dec25.105035@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="42de6f92bfc96fd863af880a7cbccf68";
logging-data="6479"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lVMe3+XzePLCgugOWrf7k1pjOrBk3Yd8="
Cancel-Lock: sha1:VbkrKw0n5mfgp1GmwLy9BcZ2Qlc=
X-Newsreader: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
 by: Jan Coombs - Sat, 25 Dec 2021 13:46 UTC

On Sat, 25 Dec 2021 09:50:35 GMT
anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:

> [rockpro64:/tmp/scowl-2020.12.07:76146] time python3
> Python 3.5.3 (default, Sep 27 2018, 17:25:39)
> [GCC 6.3.0 20170516] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> f = open("final/english-words.80","r")
> >>> print len([l for l in f if ("a" in l)])
> File "<stdin>", line 1
> print len([l for l in f if ("a" in l)])
> ^
> SyntaxError: invalid syntax

Andy's original and short versions run and produce same result using python 2 or 3 if print statement parens are added:
x86_64:$ time python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("/usr/share/dict/words", "r")
>>> print( len([l for l in f if ("a" in l)]) )
52849

real 0m6.197s
user 0m0.039s
sys 0m0.000s

x86_64:$ time python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("/usr/share/dict/words", "r")
>>> print( len([l for l in f if ("a" in l)]) )
52849

real 0m4.048s
user 0m0.040s
sys 0m0.011s

For a quick result I would use the more explicit version, which I could also write and modify faster.
Timings were similar:
user 0m0.029s Python 2
user 0m0.050s Python 3

Jan Coombs

Re: String processing, for example

<ae63e0c9-d384-4dff-86db-7713fc0f6929n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:8124:: with SMTP id 33mr9068484qvc.77.1640440431323;
Sat, 25 Dec 2021 05:53:51 -0800 (PST)
X-Received: by 2002:a05:620a:2901:: with SMTP id m1mr7192559qkp.644.1640440431174;
Sat, 25 Dec 2021 05:53:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 05:53:51 -0800 (PST)
In-Reply-To: <3f1edc15-7cac-4026-8049-a718ccc98770n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:9c5c:5254:8a19:8784;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:9c5c:5254:8a19:8784
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<2021Dec25.105035@mips.complang.tuwien.ac.at> <3f1edc15-7cac-4026-8049-a718ccc98770n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae63e0c9-d384-4dff-86db-7713fc0f6929n@googlegroups.com>
Subject: Re: String processing, for example
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 25 Dec 2021 13:53:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 21
 by: Marcel Hendrix - Sat, 25 Dec 2021 13:53 UTC

On Saturday, December 25, 2021 at 12:51:37 PM UTC+1, Nickolay Kolchin wrote:
[..]
> What a great example.

> iForth also refuses to build it.

Really?

FORTH> : counts ( c-addr u -- n )
<3>[FORTH>] 0 >r
<3>[FORTH>] begin
[3]<3>[FORTH>] 'a' scan dup
[3]<3>[FORTH>] while
[6]<3>[FORTH>] r> 1+ >r
[6]<3>[FORTH>] #10 scan dup 0=
[6]<3>[FORTH>] until then
<3>[FORTH>] 2drop r> ; ok
FORTH> S" Hallo, aarde." counts . 1 ok
FORTH> S\" Hallo, aarde.\nMaan hier." counts . 2 ok
FORTH> S\" Hallo, aarde.\nMa\na\nn hier." counts . 3 ok

-marcel

Re: String processing, for example

<1bb9d3d9-010b-4a74-ad42-178d4ff70fabn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:44cd:: with SMTP id r196mr7428332qka.90.1640440577996;
Sat, 25 Dec 2021 05:56:17 -0800 (PST)
X-Received: by 2002:a05:6214:202f:: with SMTP id 15mr9144698qvf.37.1640440577716;
Sat, 25 Dec 2021 05:56:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 05:56:17 -0800 (PST)
In-Reply-To: <ae63e0c9-d384-4dff-86db-7713fc0f6929n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<2021Dec25.105035@mips.complang.tuwien.ac.at> <3f1edc15-7cac-4026-8049-a718ccc98770n@googlegroups.com>
<ae63e0c9-d384-4dff-86db-7713fc0f6929n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1bb9d3d9-010b-4a74-ad42-178d4ff70fabn@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sat, 25 Dec 2021 13:56:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Nickolay Kolchin - Sat, 25 Dec 2021 13:56 UTC

On Saturday, December 25, 2021 at 4:53:52 PM UTC+3, Marcel Hendrix wrote:
> On Saturday, December 25, 2021 at 12:51:37 PM UTC+1, Nickolay Kolchin wrote:
> [..]
> > What a great example.
> > iForth also refuses to build it.
> Really?
>
> FORTH> : counts ( c-addr u -- n )
> <3>[FORTH>] 0 >r
> <3>[FORTH>] begin
> [3]<3>[FORTH>] 'a' scan dup
> [3]<3>[FORTH>] while
> [6]<3>[FORTH>] r> 1+ >r
> [6]<3>[FORTH>] #10 scan dup 0=
> [6]<3>[FORTH>] until then
> <3>[FORTH>] 2drop r> ; ok
> FORTH> S" Hallo, aarde." counts . 1 ok
> FORTH> S\" Hallo, aarde.\nMaan hier." counts . 2 ok
> FORTH> S\" Hallo, aarde.\nMa\na\nn hier." counts . 3 ok
>

That's unfair. You haven't compiled 'main-ertl'.

P.S. But I'm on iForth4, so who knows.

Re: String processing, for example

<ed342c5c-b1ef-42ee-9c7d-7cc154b83970n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:bd05:: with SMTP id n5mr7455067qkf.293.1640447936667;
Sat, 25 Dec 2021 07:58:56 -0800 (PST)
X-Received: by 2002:ac8:5993:: with SMTP id e19mr8421673qte.568.1640447936439;
Sat, 25 Dec 2021 07:58:56 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 07:58:56 -0800 (PST)
In-Reply-To: <164037894202.1384.9410906461200956517@media.vsta.org>
Injection-Info: google-groups.googlegroups.com; posting-host=97.87.183.68; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 97.87.183.68
References: <164037894202.1384.9410906461200956517@media.vsta.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ed342c5c-b1ef-42ee-9c7d-7cc154b83970n@googlegroups.com>
Subject: Re: String processing, for example
From: luser.dr...@gmail.com (luser droog)
Injection-Date: Sat, 25 Dec 2021 15:58:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 60
 by: luser droog - Sat, 25 Dec 2021 15:58 UTC

On Friday, December 24, 2021 at 3:01:50 PM UTC-6, Andy Valencia wrote:
> So if you wanted a "descendent of Forth" which fit the hand nicely in the
> current compute environment, how about strings? I thought of the toy problem
> of counting the number of words in the diction with an "a" in them:
>
> >>> f = open("/usr/share/dict/words", "r")
> >>> na = 0
> >>> for l in f:
> ... if "a" in l:
> ... na += 1
> ...
> >>> print na
> 52849
> >>>
>
> (Python, obviously, and it took .13 CPU seconds on an arm64
> device, the RockPRO64. The file is 102,401 lines.)
>
> I typed it in just on the fly, no IDE or any dev references needed, and got
> it right on the first go--not too surprising.
>
> It could go shorter:
>
> >>> print len([l for l in f if ("a" in l)])
> 52849
> >>>
>
> And--I was surprised--using the same amount of CPU.
>
> Forth as hand written assembly code for a stack machine will never touch
> this. I've tried many times to find the language which brings higher level
> of expressiveness. Failed every time so far.
>
> Andy Valencia
> Home page: https://www.vsta.org/andy/
> To contact me: https://www.vsta.org/contact/andy.html

I thought PostScript might be good at this, and it's broadly construed
as a Forth variant (though its actually history suggests a common ancestor
in the Burrough's Large System architecture). It has a string type, at least.

I had to add a few helper functions to my toolbag.

each-line {src proc}{
src type /stringtype eq { /src src (r) file store } if
{
src 512 string readline {proc}{pop exit} ifelse
} loop
} @func
contains { search { pop pop pop true }{ pop false } ifelse }

And there's a bit of boilerplate to use it from the command line.

$ gsnd -q -dNOSAFER struct2.ps -c "[(struct2.ps){}each-line]{(a)contains{1}{0}ifelse}map{add}reduce = quit"
60
$ gsnd -q -dNOSAFER struct2.ps -c "[(struct2.ps){(a)contains{1}{0}ifelse}each-line]{add}reduce = quit"
60

It can probably be shorter using Anton's idea to suppress the zeros and
take the length of the array. (I also don't have /usr/share/dict/word but
I doubt ghostscript is going to win any speed contests.)

Re: String processing, for example

<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:d66:: with SMTP id 6mr10046806qvs.85.1640465676978;
Sat, 25 Dec 2021 12:54:36 -0800 (PST)
X-Received: by 2002:a05:620a:4087:: with SMTP id f7mr8159673qko.56.1640465676823;
Sat, 25 Dec 2021 12:54:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 25 Dec 2021 12:54:36 -0800 (PST)
In-Reply-To: <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=148.167.132.245; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 148.167.132.245
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com>
Subject: Re: String processing, for example
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Sat, 25 Dec 2021 20:54:36 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 32
 by: Hugh Aguilar - Sat, 25 Dec 2021 20:54 UTC

On Saturday, December 25, 2021 at 4:25:22 AM UTC-7, minf...@arcor.de wrote:
> Nickolay Kolchin schrieb am Samstag, 25. Dezember 2021 um 11:45:19 UTC+1:
> > On Saturday, December 25, 2021 at 1:28:10 PM UTC+3, minf...@arcor.de wrote:
> > But the very concept of combinators is noteworthy and should be borrowed.
> > Sometimes they allow you to avoid complicated manipulations with the stack.
> Once you have quotations in your Forth, eg
> https://www.complang.tuwien.ac.at/forth/ansforth-cvs/quotations.txt
> combinators shouldn't be too difficult to implement.

Factor's combinators were the inspiration for my rquotations.
It is necessary for the rquotation to have access to the parent function's local variables
despite the HOF (higher-order-function called by the parent function that executes
the rquotation) having local variables of its own.

The idea that the Paysan-faked quotations, that lack this feature, are a step toward
combinators is total baloney! This is just Forth-200x fantasy, not based on reality at all.

My rquotations only work one level deep, so they are not like Factor combinators that can
stay in scope at any level deep from the parent function and can even stay in scope after the
parent function has exited. Factor combinators are like closures in Lisp, and Common Lisp
is in fact Slava's background. This isn't necessary for my purposes. I am just supporting
general-purpose data-structures. The idea is that the HOF traverses a data-structure and
executes the rquotation that it is given for every node in the data-structure. The programmer
who writes the HOF has to know how the data-structure is implemented internally, but does
not need to know what they payload is. The application programmer who writes the parent
function and the rquotation has to know what the payload is (this is specific to the application)
but does not have to know how the data-structure or HOF are implemented internally.
This is called information hiding!

In regard to your string pattern-matching and replacement program, that would be trivial
given the novice-package that has STRING-STACK.4TH, rquotations, ASSOCIATION.4TH etc..
The novice--package really makes programming easy!

Re: String processing, for example

<7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:b5c3:: with SMTP id e186mr9086365qkf.747.1640511820827;
Sun, 26 Dec 2021 01:43:40 -0800 (PST)
X-Received: by 2002:a05:622a:10e:: with SMTP id u14mr10433494qtw.493.1640511820569;
Sun, 26 Dec 2021 01:43:40 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 26 Dec 2021 01:43:40 -0800 (PST)
In-Reply-To: <e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Sun, 26 Dec 2021 09:43:40 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 3
 by: Nickolay Kolchin - Sun, 26 Dec 2021 09:43 UTC

On Saturday, December 25, 2021 at 11:54:37 PM UTC+3, Hugh Aguilar wrote:
> Factor's combinators were the inspiration for my rquotations.

Can you share a link to your factor vs forth comparison?

Re: String processing, for example

<59abf289-1633-47a5-b83c-0c6405c30fc0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5f89:: with SMTP id jp9mr11537977qvb.39.1640514008001;
Sun, 26 Dec 2021 02:20:08 -0800 (PST)
X-Received: by 2002:ac8:590a:: with SMTP id 10mr10973083qty.186.1640514007774;
Sun, 26 Dec 2021 02:20:07 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 26 Dec 2021 02:20:07 -0800 (PST)
In-Reply-To: <8735mhvcsz.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=37.33.189.33; posting-account=kiOBZQoAAADFsAs31ZHaefxTuQxv84Wm
NNTP-Posting-Host: 37.33.189.33
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<sq5hri$p48$1@dont-email.me> <8735mhvcsz.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <59abf289-1633-47a5-b83c-0c6405c30fc0n@googlegroups.com>
Subject: Re: String processing, for example
From: jali.hei...@gmail.com (Jali Heinonen)
Injection-Date: Sun, 26 Dec 2021 10:20:07 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 19
 by: Jali Heinonen - Sun, 26 Dec 2021 10:20 UTC

lauantai 25. joulukuuta 2021 klo 0.49.18 UTC+2 Paul Rubin kirjoitti:
> meff <em...@example.com> writes:
> We have Oforth, 8th, Factor, and maybe some others as Forth-descended
> languages that might fit the bill. These all have their aficionados.
> I'm personally not that enthused about any of them, since the Forth
> features they preserve (RPN and visible stacks) are imho not that
> helpful once the language implementation is that complicated. But
> that's just me.

8th fits the bill nicely as there are high level words for string processing. I would probably write something like:

0 "/usr/share/dict/words" f:slurp
( "a" search null? nip nip if n:1+ then ) s:eachline . cr

or a little slower:

0 "/usr/share/dict/words" f:open-ro
( "a" search null? nip nip if n:1+ then ) f:eachline drop . cr

My dictionary is a lot bigger: 654299 lines. First code runs in: 0m0.341s on my Raspberry PI 4B.

Re: String processing, for example

<sq9g8h$ttv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Sun, 26 Dec 2021 12:30:41 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <sq9g8h$ttv$1@dont-email.me>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<sq5hri$p48$1@dont-email.me> <8735mhvcsz.fsf@nightsong.com>
<59abf289-1633-47a5-b83c-0c6405c30fc0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 26 Dec 2021 10:30:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="c5fc851fafca6254abeb81f6c59416cb";
logging-data="30655"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VHhOsoiIsJCOaUyB30Gqn"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Cancel-Lock: sha1:FSQmJe8ZFFrT8u5seEJmfWgPc24=
In-Reply-To: <59abf289-1633-47a5-b83c-0c6405c30fc0n@googlegroups.com>
Content-Language: en-US
 by: Ron AARON - Sun, 26 Dec 2021 10:30 UTC

On 26/12/2021 12:20, Jali Heinonen wrote:
> lauantai 25. joulukuuta 2021 klo 0.49.18 UTC+2 Paul Rubin kirjoitti:
>> meff <em...@example.com> writes:
>> We have Oforth, 8th, Factor, and maybe some others as Forth-descended
>> languages that might fit the bill. These all have their aficionados.
>> I'm personally not that enthused about any of them, since the Forth
>> features they preserve (RPN and visible stacks) are imho not that
>> helpful once the language implementation is that complicated. But
>> that's just me.
>
> 8th fits the bill nicely as there are high level words for string processing. I would probably write something like:
>
> 0 "/usr/share/dict/words" f:slurp
> ( "a" search null? nip nip if n:1+ then ) s:eachline . cr
>
> or a little slower:
>
> 0 "/usr/share/dict/words" f:open-ro
> ( "a" search null? nip nip if n:1+ then ) f:eachline drop . cr
>
> My dictionary is a lot bigger: 654299 lines. First code runs in: 0m0.341s on my Raspberry PI 4B.

I also took a look, my version:

0 >r "/usr/share/dict/words" f:open-ro
( "a" s:search number? if 1 r+ then 2drop ) f:eachline drop
r> . cr bye

Re: String processing, for example

<5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:23ca:: with SMTP id hr10mr13848078qvb.82.1640574746822;
Sun, 26 Dec 2021 19:12:26 -0800 (PST)
X-Received: by 2002:ad4:5aeb:: with SMTP id c11mr14026523qvh.25.1640574746705;
Sun, 26 Dec 2021 19:12:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 26 Dec 2021 19:12:26 -0800 (PST)
In-Reply-To: <7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=148.167.132.245; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 148.167.132.245
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com> <7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com>
Subject: Re: String processing, for example
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Mon, 27 Dec 2021 03:12:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 57
 by: Hugh Aguilar - Mon, 27 Dec 2021 03:12 UTC

On Sunday, December 26, 2021 at 2:43:41 AM UTC-7, Nickolay Kolchin wrote:
> On Saturday, December 25, 2021 at 11:54:37 PM UTC+3, Hugh Aguilar wrote:
> > Factor's combinators were the inspiration for my rquotations.
> Can you share a link to your factor vs forth comparison?

I haven't written any Factor vs Forth comparison.
In regard to how combinators inspired rquotations, that is obvious.
Here are a couple of HOFs that use rquotations similar to Factor:
------------------------------------------------------------------------------------------------------------------
: |iterate { cnt rq -- }
begin cnt while
rq rex
-1 +to cnt repeat ;

: |until { cnt rq | original -- completed }
cnt to original
begin cnt while
rq rex
-1 +to cnt
if original cnt - exit then
repeat
original ;
------------------------------------------------------------------------------------------------------------------

Here are some functions that use |ITERATE internally.
------------------------------------------------------------------------------------------------------------------

: old-up. \ limit n -- \ assumes LIMIT is above N
?do I . loop ;

: up. ( limit n -- ) \ assumes LIMIT is above N
tuck - r[ dup . 1+ ]r |iterate drop ;

: old-down. \ limit n -- \ assumes LIMIT is below N
swap 1+ swap ?do I . -1 +loop ;

: down. ( limit n -- ) \ assumes LIMIT is below N
tuck - negate r[ dup . 1- ]r |iterate drop ;

: design ( val -- |val| sign )
dup 0< if negate -1 exit then
1 ;

: through. ( limit n -- )
tuck - \ -- n count
design -rot \ -- step n |count|
r[ dup . over + ]r |iterate 2drop ;

: through. { limit n | step -- }
limit n - \ -- count
design to step \ -- |count|
r[ n . step +to n ]r |iterate ;
------------------------------------------------------------------------------------------------------------------

For the most part though, I don't think it is a good idea to use rquotations
for iteration. The rquotations are primarily for supporting general-purpose
data-structures.

Re: String processing, for example

<564314e4-e0e1-4926-ac32-5f26c0de6b89n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:57c2:: with SMTP id w2mr13257218qta.54.1640574959410;
Sun, 26 Dec 2021 19:15:59 -0800 (PST)
X-Received: by 2002:a05:620a:121b:: with SMTP id u27mr11015778qkj.419.1640574959165;
Sun, 26 Dec 2021 19:15:59 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 26 Dec 2021 19:15:59 -0800 (PST)
In-Reply-To: <5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com> <7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
<5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <564314e4-e0e1-4926-ac32-5f26c0de6b89n@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Mon, 27 Dec 2021 03:15:59 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: Nickolay Kolchin - Mon, 27 Dec 2021 03:15 UTC

On Monday, December 27, 2021 at 6:12:27 AM UTC+3, Hugh Aguilar wrote:
> On Sunday, December 26, 2021 at 2:43:41 AM UTC-7, Nickolay Kolchin wrote:
> > On Saturday, December 25, 2021 at 11:54:37 PM UTC+3, Hugh Aguilar wrote:
> > > Factor's combinators were the inspiration for my rquotations.
> > Can you share a link to your factor vs forth comparison?
> I haven't written any Factor vs Forth comparison.

I thought that was your text: http://www.rosycrew.org/FactorVsForth.pdf

- https://twitter.com/shishini/status/1060677855946915841

Re: String processing, for example

<87lf06tqod.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: String processing, for example
Date: Mon, 27 Dec 2021 00:09:22 -0800
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <87lf06tqod.fsf@nightsong.com>
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com>
<63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com>
<3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com>
<7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
<5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com>
<564314e4-e0e1-4926-ac32-5f26c0de6b89n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="4ac5b7508eaaf8cdbec23066036dac05";
logging-data="16663"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OPgkk6A3Unz/teT2uqKux"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:UwBHkvD/J5Wa7R/4Qk6VNJFI4HY=
sha1:K9yfKwzx9yFcn8z5HcjFYmnvWr8=
 by: Paul Rubin - Mon, 27 Dec 2021 08:09 UTC

Nickolay Kolchin <nbkolchin@gmail.com> writes:
> I thought that was your text: http://www.rosycrew.org/FactorVsForth.pdf
> - https://twitter.com/shishini/status/1060677855946915841

The rosycrew url won't connect and the weibo one linked in the tweet
goes to weibo's main page in Chinese. Factorcode.org is also down.

I haven't looked closely at Factor but I think of it (maybe incorrectly)
as Lisp-like but with postfix syntax.

Re: String processing, for example

<a1719fa9-b8b2-4508-9d61-3fa198192a11n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5ca6:: with SMTP id q6mr13897648qvh.71.1640595292086;
Mon, 27 Dec 2021 00:54:52 -0800 (PST)
X-Received: by 2002:ac8:5993:: with SMTP id e19mr13107971qte.568.1640595291793;
Mon, 27 Dec 2021 00:54:51 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 27 Dec 2021 00:54:51 -0800 (PST)
In-Reply-To: <87lf06tqod.fsf@nightsong.com>
Injection-Info: google-groups.googlegroups.com; posting-host=213.21.29.203; posting-account=DoM31goAAADuzlbg5XKrMFannjkYS2Lr
NNTP-Posting-Host: 213.21.29.203
References: <164037894202.1384.9410906461200956517@media.vsta.org>
<bc242950-daa6-44ae-b5e0-4f08b2223f3bn@googlegroups.com> <63093c53-b2bc-4040-84ea-219b04a92469n@googlegroups.com>
<76173736-56dd-4215-9300-a0cefff381a3n@googlegroups.com> <3ce46474-25c8-4f78-ac4a-15c2c2cd117bn@googlegroups.com>
<e8f5194f-a6d6-4613-aa51-c13069c757b7n@googlegroups.com> <7d50db0d-ae4a-4559-9bb0-583beddf5ef1n@googlegroups.com>
<5fd9fe61-9f72-40f4-81de-5098a5e26806n@googlegroups.com> <564314e4-e0e1-4926-ac32-5f26c0de6b89n@googlegroups.com>
<87lf06tqod.fsf@nightsong.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1719fa9-b8b2-4508-9d61-3fa198192a11n@googlegroups.com>
Subject: Re: String processing, for example
From: nbkolc...@gmail.com (Nickolay Kolchin)
Injection-Date: Mon, 27 Dec 2021 08:54:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Nickolay Kolchin - Mon, 27 Dec 2021 08:54 UTC

On Monday, December 27, 2021 at 11:09:26 AM UTC+3, Paul Rubin wrote:
> Nickolay Kolchin <nbko...@gmail.com> writes:
> > I thought that was your text: http://www.rosycrew.org/FactorVsForth.pdf
> > - https://twitter.com/shishini/status/1060677855946915841
> The rosycrew url won't connect and the weibo one linked in the tweet
> goes to weibo's main page in Chinese. Factorcode.org is also down.

Yes, that's why I asked Hugh for pdf. It was written ages ago when Factor
was different, but still can be interesting as a "die-hard" forther view on
a different stack-based language.

>
> I haven't looked closely at Factor but I think of it (maybe incorrectly)
> as Lisp-like but with postfix syntax.

And I thought about APL with RPN notation. :)

Pages:1234567891011
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor