Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

<lilo> I've always wanted to have a web site with a big picture of a carrot on it


devel / comp.lang.forth / Re: RANDOM routine pulled from an old paper

SubjectAuthor
* RANDOM routine pulled from an old paperHans Bezemer
+* Re: RANDOM routine pulled from an old paperminforth
|`* Re: RANDOM routine pulled from an old paperHans Bezemer
| +* Re: RANDOM routine pulled from an old paperminforth
| |+* Re: RANDOM routine pulled from an old papermhx
| ||`- Re: RANDOM routine pulled from an old paperminforth
| |`* Re: RANDOM routine pulled from an old paperdxf
| | `* Re: RANDOM routine pulled from an old paperHans Bezemer
| |  `* Re: RANDOM routine pulled from an old papernone
| |   `* Re: RANDOM routine pulled from an old paperdxf
| |    `* Re: RANDOM routine pulled from an old papernone
| |     `- Re: RANDOM routine pulled from an old paperdxf
| `- Re: RANDOM routine pulled from an old paperdxf
`* Re: RANDOM routine pulled from an old paperminforth
 `* Re: RANDOM routine pulled from an old paperminforth
  `* Re: RANDOM routine pulled from an old papermhx
   +- Re: RANDOM routine pulled from an old paperminforth
   +* Re: RANDOM routine pulled from an old papernone
   |`- Re: RANDOM routine pulled from an old papermhx
   `* Re: RANDOM routine pulled from an old paperdxf
    `- Re: RANDOM routine pulled from an old papermhx

1
RANDOM routine pulled from an old paper

<810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25126&group=comp.lang.forth#25126

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1a04:b0:778:9071:2b3c with SMTP id bk4-20020a05620a1a0400b0077890712b3cmr30606qkb.0.1699436792431;
Wed, 08 Nov 2023 01:46:32 -0800 (PST)
X-Received: by 2002:a4a:8c50:0:b0:589:d4e9:69b3 with SMTP id
v16-20020a4a8c50000000b00589d4e969b3mr429262ooj.1.1699436792218; Wed, 08 Nov
2023 01:46:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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, 8 Nov 2023 01:46:31 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
Subject: RANDOM routine pulled from an old paper
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Wed, 08 Nov 2023 09:46:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2629
 by: Hans Bezemer - Wed, 8 Nov 2023 09:46 UTC

Maybe it is useful to someone. It seems to work just fine. I have no Forth-79 compiler to verify it.

: ARRAY CELLS ALLOT ;

I think it's quite obvious but anyways. The curious part is that the author seems to prefer 1-indexed arrays instead of 0-indexed ones.

Hans Bezemer

\ A Portable FORTH Random Number Generator, William T. Doyle
\ The Journal of Forth Application and Research Vol. I. Number 2. Dec. 1983

\ When seeded with the word RND.INIT the sequences produced are identical
\ to those produced by Knuth's FORTRAN subroutine with the same seed and
\ number range.

\ ANS conversion by Hans Bezemer, 2023
\ Converted to a single word version

( RANDOM NUMBER GENERATOR FORTH-79 WTD)

55 ARRAY RND DOES> SWAP 1- CELLS + ; ( 55 RANDOM NRS IN RND )

VARIABLE TALLY 0 TALLY !
VARIABLE SEED 314159296 SEED !

: CYCLE ( N I A --- N2)
DUP >R @ 1+ DUP ROT > IF DROP 1 THEN DUP R> ! ;

: STEP ( A --- N+ I)
55 TALLY CYCLE ;

( RANDOM NUMBER GENERATOR 2 )
: RND.INIT ( --- )
0 TALLY ! SEED @ DUP 55 RND !
1 SWAP 55 1 DO OVER DUP 21
I * 55 MOD RND ! - DUP 0< IF
1000000000 + THEN SWAP LOOP
DROP DROP ;

: RANDOM ( --- N)
STEP DUP >R RND @ DUP R@ DUP
25 < IF 31 + ELSE 24 - THEN RND
@ - DUP 0< IF 1000000000 +
THEN R> RND ! ;

( RANDOM NUMBER GENERATOR 3)
: WARMUP ( --- )
221 1 DO RANDOM DROP LOOP ;
: RANDOMIZE ( N --- )
TALLY ! RND.INIT WARMUP ;

0 randomize random . cr depth .

Re: RANDOM routine pulled from an old paper

<a6250518598e36d8f5da1932306df9c3@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25129&group=comp.lang.forth#25129

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Wed, 8 Nov 2023 12:59:02 +0000
Organization: novaBBS
Message-ID: <a6250518598e36d8f5da1932306df9c3@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="245418"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
X-Rslight-Site: $2y$10$T9cL6lpAt1Q4Q0Br49.jceQAIjBPckAHa6VhBaIU5DUWOqtk1cAbS
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: minforth - Wed, 8 Nov 2023 12:59 UTC

Hans Bezemer wrote:

> 55 ARRAY RND DOES> SWAP 1- CELLS + ; ( 55 RANDOM NRS IN RND )

This DOES> must either have defined interpretation semantics
or something else is missing here...

Re: RANDOM routine pulled from an old paper

<fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25130&group=comp.lang.forth#25130

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:16c8:b0:66d:9b:9389 with SMTP id d8-20020a05621416c800b0066d009b9389mr36061qvz.5.1699461128727;
Wed, 08 Nov 2023 08:32:08 -0800 (PST)
X-Received: by 2002:a9d:7c95:0:b0:6bc:fab5:e998 with SMTP id
q21-20020a9d7c95000000b006bcfab5e998mr686376otn.1.1699461128516; Wed, 08 Nov
2023 08:32:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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, 8 Nov 2023 08:32:08 -0800 (PST)
In-Reply-To: <a6250518598e36d8f5da1932306df9c3@news.novabbs.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <a6250518598e36d8f5da1932306df9c3@news.novabbs.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
Subject: Re: RANDOM routine pulled from an old paper
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Wed, 08 Nov 2023 16:32:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1953
 by: Hans Bezemer - Wed, 8 Nov 2023 16:32 UTC

On Wednesday, November 8, 2023 at 2:02:32 PM UTC+1, minforth wrote:
> Hans Bezemer wrote:
>
> > 55 ARRAY RND DOES> SWAP 1- CELLS + ; ( 55 RANDOM NRS IN RND )
> This DOES> must either have defined interpretation semantics
> or something else is missing here...

Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `help' for basic help
: array create cells allot ; ok
55 ARRAY RND DOES> SWAP 1- CELLS + ; ok
25 1 rnd ! ok

Works fine.. As Bernd said "It's trivial to add interpretation semantics.. So why not?"

But if you're happier with ": ARRAY CREATE CELLS ALLOT DOES> SWAP 1- CELLS + ;"
then go for it. I told you: "some assembly required"..

Hans Bezemer

Re: RANDOM routine pulled from an old paper

<e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25131&group=comp.lang.forth#25131

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Wed, 8 Nov 2023 16:58:09 +0000
Organization: novaBBS
Message-ID: <e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <a6250518598e36d8f5da1932306df9c3@news.novabbs.com> <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="264593"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$BLgAMWl42QbHTYkgYhhVpOinbWCFXrCB3q/MuUIWdqf3NnyQATWfu
X-Spam-Level: *
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: minforth - Wed, 8 Nov 2023 16:58 UTC

Hans Bezemer wrote:

> On Wednesday, November 8, 2023 at 2:02:32 PM UTC+1, minforth wrote:
>> Hans Bezemer wrote:
>>
>> > 55 ARRAY RND DOES> SWAP 1- CELLS + ; ( 55 RANDOM NRS IN RND )
>> This DOES> must either have defined interpretation semantics
>> or something else is missing here...

> Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> Type `help' for basic help
> : array create cells allot ; ok
> 55 ARRAY RND DOES> SWAP 1- CELLS + ; ok
> 25 1 rnd ! ok

> Works fine.. As Bernd said "It's trivial to add interpretation semantics.. So why not?"

> But if you're happier with ": ARRAY CREATE CELLS ALLOT DOES> SWAP 1- CELLS + ;"
> then go for it. I told you: "some assembly required"..

Of course. Didn't know it was done in gforth dialect.

I like my interpretative DO..LOOP or better FOR..NEXT as well.

Re: RANDOM routine pulled from an old paper

<5b443b34ad6c5a3d083185db43efea3b@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25132&group=comp.lang.forth#25132

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Wed, 8 Nov 2023 17:50:31 +0000
Organization: novaBBS
Message-ID: <5b443b34ad6c5a3d083185db43efea3b@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <a6250518598e36d8f5da1932306df9c3@news.novabbs.com> <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com> <e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="268025"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 463cbf1a76c808942982a163321348c75477c065
X-Rslight-Site: $2y$10$nW01/1X4JoaXyy3WrpLjQet8arFjgahd3sBURVzKwAFUU0GfbGvVK
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: mhx - Wed, 8 Nov 2023 17:50 UTC

minforth wrote:
[..]
> Of course. Didn't know it was done in gforth dialect.

Well, from the posting's comments one might think it is a truthful
copy of the code in the original paper, for 16-bit Forth79.

Assuming William Boyle did not have a 64-bit Forth79 compiler,
"314159296" and "1000000000" differ from the original critical
constants. This makes it doubtful the generator has the
statistical properties Knuth intended. (Given that William
Boyd converted Knuth's Fortran code correctly! Was there ever
a Fortran with a 16-bit integer RND function?)

-marcel

Re: RANDOM routine pulled from an old paper

<0d232f7a192789de30ac0c813ee47faa@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25341&group=comp.lang.forth#25341

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Thu, 9 Nov 2023 10:30:35 +0000
Organization: novaBBS
Message-ID: <0d232f7a192789de30ac0c813ee47faa@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <a6250518598e36d8f5da1932306df9c3@news.novabbs.com> <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com> <e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com> <5b443b34ad6c5a3d083185db43efea3b@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="336542"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$6skLWHEN4xA8qmEOi734.OyRjc3GWR4ViG72cZ7kJAP/v.OtfYo3q
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
 by: minforth - Thu, 9 Nov 2023 10:30 UTC

mhx wrote:
> Well, from the posting's comments one might think it is a truthful
> copy of the code in the original paper, for 16-bit Forth79.

Aah, Forth folklore and nostalgia.. ;-)

> Assuming William Boyle did not have a 64-bit Forth79 compiler,
> "314159296" and "1000000000" differ from the original critical
> constants. This makes it doubtful the generator has the
> statistical properties Knuth intended. (Given that William
> Boyd converted Knuth's Fortran code correctly! Was there ever
> a Fortran with a 16-bit integer RND function?)

I have Shishua in my (non-standard Forth) libraries:
https://espadrine.github.io/blog/posts/shishua-the-fastest-prng-in-the-world.html
(obviously not in MinForth)

Re: RANDOM routine pulled from an old paper

<uiigfr$265u2$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25342&group=comp.lang.forth#25342

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Thu, 9 Nov 2023 22:40:44 +1100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <uiigfr$265u2$1@dont-email.me>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<a6250518598e36d8f5da1932306df9c3@news.novabbs.com>
<fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 9 Nov 2023 11:40:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7a98e6c85253dbb3ee44846a2422717d";
logging-data="2299842"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+++k8OpgLyGyi5WwXGEUy"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:J9JF+YU2i+c8UE6ZR5/Eitg4hgA=
In-Reply-To: <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
Content-Language: en-GB
 by: dxf - Thu, 9 Nov 2023 11:40 UTC

On 9/11/2023 3:32 am, Hans Bezemer wrote:
> On Wednesday, November 8, 2023 at 2:02:32 PM UTC+1, minforth wrote:
>> Hans Bezemer wrote:
>>
>>> 55 ARRAY RND DOES> SWAP 1- CELLS + ; ( 55 RANDOM NRS IN RND )
>> This DOES> must either have defined interpretation semantics
>> or something else is missing here...
>
> Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
> Type `help' for basic help
> : array create cells allot ; ok
> 55 ARRAY RND DOES> SWAP 1- CELLS + ; ok
> 25 1 rnd ! ok
>
> Works fine.. As Bernd said "It's trivial to add interpretation semantics.. So why not?"
>
> But if you're happier with ": ARRAY CREATE CELLS ALLOT DOES> SWAP 1- CELLS + ;"
> then go for it. I told you: "some assembly required"..

Alternatively

:NONAME DOES> SWAP 1- CELLS + ; ( xt)
CREATE RND 55 CELLS ALLOT
( xt) EXECUTE

Re: RANDOM routine pulled from an old paper

<654d603a$1@news.ausics.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25343&group=comp.lang.forth#25343

  copy link   Newsgroups: comp.lang.forth
Date: Fri, 10 Nov 2023 09:42:05 +1100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: RANDOM routine pulled from an old paper
Newsgroups: comp.lang.forth
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<a6250518598e36d8f5da1932306df9c3@news.novabbs.com>
<fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
<e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>
Content-Language: en-GB
From: dxforth@gmail.com (dxf)
In-Reply-To: <e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <654d603a$1@news.ausics.net>
Organization: Ausics - https://ausics.net
Lines: 6
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: dxf - Thu, 9 Nov 2023 22:42 UTC

On 9/11/2023 3:58 am, minforth wrote:
>
> I like my interpretative DO..LOOP or better FOR..NEXT as well.

What is that?

Re: RANDOM routine pulled from an old paper

<ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25344&group=comp.lang.forth#25344

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:146c:b0:779:f985:76c5 with SMTP id j12-20020a05620a146c00b00779f98576c5mr179653qkl.12.1699608181496;
Fri, 10 Nov 2023 01:23:01 -0800 (PST)
X-Received: by 2002:a17:90a:9484:b0:27d:dffa:b374 with SMTP id
s4-20020a17090a948400b0027ddffab374mr1133436pjo.6.1699608181232; Fri, 10 Nov
2023 01:23:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 10 Nov 2023 01:23:00 -0800 (PST)
In-Reply-To: <654d603a$1@news.ausics.net>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<a6250518598e36d8f5da1932306df9c3@news.novabbs.com> <fb95a865-8705-4d9e-8b76-9df26a972c7dn@googlegroups.com>
<e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com> <654d603a$1@news.ausics.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>
Subject: Re: RANDOM routine pulled from an old paper
From: the.beez.speaks@gmail.com (Hans Bezemer)
Injection-Date: Fri, 10 Nov 2023 09:23:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Hans Bezemer - Fri, 10 Nov 2023 09:23 UTC

On Thursday, November 9, 2023 at 11:42:14 PM UTC+1, dxf wrote:
> On 9/11/2023 3:58 am, minforth wrote:
> >
> > I like my interpretative DO..LOOP or better FOR..NEXT as well.
> What is that?
Since everything in 4tH is compiled, you can do:

20 0 ?DO I . LOOP

*outside* of a definition. I've also seen Forths that have [DO] and [LOOP]
as interpreted equivalents. I suppose you could embed those within a regular
DO..LOOP in order to create "interpretative DO..LOOP".

In 4tH code like:

10 0 DO variable i LOOP

doesn't create a bunch of variables. As a matter of fact, it will not compile
because "I" as a name is taken. You could do that in the preprocessor though,
although the code to achieve this will not look like this - at all.

I suppose you could do something like:

10 0 [DO] variable var i & [LOOP]

in an interpreted version .. but here I'm just guessing.

Hans Bezemer

Re: RANDOM routine pulled from an old paper

<nnd$16a392ef$08f9095b@401ab3b3a7ca4973>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25345&group=comp.lang.forth#25345

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com> <654d603a$1@news.ausics.net> <ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>
Subject: Re: RANDOM routine pulled from an old paper
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$16a392ef$08f9095b@401ab3b3a7ca4973>
Organization: KPN B.V.
Date: Fri, 10 Nov 2023 11:37:26 +0100
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 66
Injection-Date: Fri, 10 Nov 2023 11:37:26 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3334
 by: none - Fri, 10 Nov 2023 10:37 UTC

In article <ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>,
Hans Bezemer <the.beez.speaks@gmail.com> wrote:
>On Thursday, November 9, 2023 at 11:42:14 PM UTC+1, dxf wrote:
>> On 9/11/2023 3:58 am, minforth wrote:
>> >
>> > I like my interpretative DO..LOOP or better FOR..NEXT as well.
>> What is that?
>Since everything in 4tH is compiled, you can do:
>
>20 0 ?DO I . LOOP
>
>*outside* of a definition. I've also seen Forths that have [DO] and [LOOP]
>as interpreted equivalents. I suppose you could embed those within a regular
>DO..LOOP in order to create "interpretative DO..LOOP".
>
>In 4tH code like:
>
>10 0 DO variable i LOOP
>
>doesn't create a bunch of variables. As a matter of fact, it will not compile
>because "I" as a name is taken. You could do that in the preprocessor though,
>although the code to achieve this will not look like this - at all.
>
>I suppose you could do something like:
>
>10 0 [DO] variable var i & [LOOP]
>
>in an interpreted version .. but here I'm just guessing.

After (in ciforth)
WANT -scripting-
you can do *all* control construct in interpreter mode.
(It is implicit in the -s option, for scripting)

T] and T[ switch to a temporary compile area. It is typically 4 Gbyte
away in a 8 Gbyte Forth, but beware of large buffers. (The same
mechanism is used for classes.)

Then it is one screen worth of definitions:

--------------------------------------------
"T]" WANTED
: IF T] POSTPONE IF ; IMMEDIATE
: DO T] POSTPONE DO ; IMMEDIATE
: ?DO T] POSTPONE ?DO ; IMMEDIATE
: BEGIN T] POSTPONE BEGIN ; IMMEDIATE
: THEN POSTPONE THEN POSTPONE T[ ; IMMEDIATE
: LOOP POSTPONE LOOP POSTPONE T[ ; IMMEDIATE
: +LOOP POSTPONE +LOOP POSTPONE T[ ; IMMEDIATE
: REPEAT POSTPONE REPEAT POSTPONE T[ ; IMMEDIATE
: UNTIL POSTPONE UNTIL POSTPONE T[ ; IMMEDIATE
: AGAIN POSTPONE AGAIN POSTPONE T[ ; IMMEDIATE
--------------------------------------------
It is insane to mint different words for this behaviour.

T] and T[ is left as an exercise. Hint: they are state-smart.

>
>Hans Bezemer
>
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: RANDOM routine pulled from an old paper

<uil4i4$2q6cm$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25346&group=comp.lang.forth#25346

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!nntp.comgw.net!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Fri, 10 Nov 2023 22:35:32 +1100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <uil4i4$2q6cm$1@dont-email.me>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<e2f8518ff05d98ba2490842bdea016a6@news.novabbs.com>
<654d603a$1@news.ausics.net>
<ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>
<nnd$16a392ef$08f9095b@401ab3b3a7ca4973>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 10 Nov 2023 11:35:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7860a06d2f2b67e16ac8ef7ff8c1d7a6";
logging-data="2955670"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+w3SzcmdnHw/KHTMuBiSO0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:lrchdIe7cUCf8VkctxtAl7R17k0=
In-Reply-To: <nnd$16a392ef$08f9095b@401ab3b3a7ca4973>
Content-Language: en-GB
 by: dxf - Fri, 10 Nov 2023 11:35 UTC

On 10/11/2023 9:37 pm, albert wrote:
> [..]
> After (in ciforth)
> WANT -scripting-
> you can do *all* control construct in interpreter mode.
> (It is implicit in the -s option, for scripting)
>
> T] and T[ switch to a temporary compile area. It is typically 4 Gbyte
> away in a 8 Gbyte Forth, but beware of large buffers. (The same
> mechanism is used for classes.)
>
> Then it is one screen worth of definitions:
>
> --------------------------------------------
> "T]" WANTED
> : IF T] POSTPONE IF ; IMMEDIATE
> : DO T] POSTPONE DO ; IMMEDIATE
> : ?DO T] POSTPONE ?DO ; IMMEDIATE
> : BEGIN T] POSTPONE BEGIN ; IMMEDIATE
> : THEN POSTPONE THEN POSTPONE T[ ; IMMEDIATE
> : LOOP POSTPONE LOOP POSTPONE T[ ; IMMEDIATE
> : +LOOP POSTPONE +LOOP POSTPONE T[ ; IMMEDIATE
> : REPEAT POSTPONE REPEAT POSTPONE T[ ; IMMEDIATE
> : UNTIL POSTPONE UNTIL POSTPONE T[ ; IMMEDIATE
> : AGAIN POSTPONE AGAIN POSTPONE T[ ; IMMEDIATE
> --------------------------------------------
> It is insane to mint different words for this behaviour.
>
> T] and T[ is left as an exercise. Hint: they are state-smart.

Do you have some examples? I'm still puzzled what these have over the
regular functions.

Re: RANDOM routine pulled from an old paper

<nnd$7c36a778$2d52340e@a83ff788cb758c62>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25350&group=comp.lang.forth#25350

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com> <nnd$16a392ef$08f9095b@401ab3b3a7ca4973> <uil4i4$2q6cm$1@dont-email.me>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$7c36a778$2d52340e@a83ff788cb758c62>
Organization: KPN B.V.
Date: Sat, 11 Nov 2023 11:07:26 +0100
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!feed.abavia.com!abe006.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 67
Injection-Date: Sat, 11 Nov 2023 11:07:26 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Sat, 11 Nov 2023 10:07 UTC

In article <uil4i4$2q6cm$1@dont-email.me>, dxf <dxforth@gmail.com> wrote:
>On 10/11/2023 9:37 pm, albert wrote:
>> [..]
>> After (in ciforth)
>> WANT -scripting-
>> you can do *all* control construct in interpreter mode.
>> (It is implicit in the -s option, for scripting)
>>
>> T] and T[ switch to a temporary compile area. It is typically 4 Gbyte
>> away in a 8 Gbyte Forth, but beware of large buffers. (The same
>> mechanism is used for classes.)
>>
>> Then it is one screen worth of definitions:
>>
>> --------------------------------------------
>> "T]" WANTED
>> : IF T] POSTPONE IF ; IMMEDIATE
>> : DO T] POSTPONE DO ; IMMEDIATE
>> : ?DO T] POSTPONE ?DO ; IMMEDIATE
>> : BEGIN T] POSTPONE BEGIN ; IMMEDIATE
>> : THEN POSTPONE THEN POSTPONE T[ ; IMMEDIATE
>> : LOOP POSTPONE LOOP POSTPONE T[ ; IMMEDIATE
>> : +LOOP POSTPONE +LOOP POSTPONE T[ ; IMMEDIATE
>> : REPEAT POSTPONE REPEAT POSTPONE T[ ; IMMEDIATE
>> : UNTIL POSTPONE UNTIL POSTPONE T[ ; IMMEDIATE
>> : AGAIN POSTPONE AGAIN POSTPONE T[ ; IMMEDIATE
>> --------------------------------------------
>> It is insane to mint different words for this behaviour.
>>
>> T] and T[ is left as an exercise. Hint: they are state-smart.
>
>Do you have some examples? I'm still puzzled what these have over the
>regular functions.
>
>

A typical example is
( CRC64 ) CF: ?64 \ AvdH C2feb27

"BOUNDS" WANTED "-scripting-" WANTED HEX
\ Well the polynomial
C96C,5795,D787,0F42 CONSTANT CRC64_POLYNOMIAL \ ECMA-182
\ Auxiliary table with values for single bytes.
CREATE CRCTable
100 0 DO I 8 0 DO
DUP >R 1 RSHIFT R> 1 AND IF CRC64_POLYNOMIAL XOR THEN
LOOP , LOOP
\ For initial CRC and BUFFER COUNT pair, leave the updated CRC
: CRC-MORE BOUNDS ?DO DUP I C@ XOR 0FF AND CELLS CRCTable + @
SWAP 8 RSHIFT XOR LOOP ;
\ For BUFFER COUNT pair, leave the CRC .
: CRC64 -1 ROT ROT CRC-MORE INVERT ;
DECIMAL

------------------
Building the crc table you need not worry about a temp definition
and whether its code land in the middle of the table you want to
define. Also there is no entry in the dictionary that you never
want to use again.

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: RANDOM routine pulled from an old paper

<uiprp3$8i6$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25352&group=comp.lang.forth#25352

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Sun, 12 Nov 2023 17:36:19 +1100
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <uiprp3$8i6$1@dont-email.me>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<ec1b613d-cf8e-4bf0-ba73-eab288a15089n@googlegroups.com>
<nnd$16a392ef$08f9095b@401ab3b3a7ca4973> <uil4i4$2q6cm$1@dont-email.me>
<nnd$7c36a778$2d52340e@a83ff788cb758c62>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 12 Nov 2023 06:36:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f84cd5b4a29d913ae73bb8c8cb3c6d8a";
logging-data="8774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/euYMasHNaDjLhDfGgQYEX"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JaDCNcVD8ptueUw8huN1HULWLmM=
In-Reply-To: <nnd$7c36a778$2d52340e@a83ff788cb758c62>
Content-Language: en-GB
 by: dxf - Sun, 12 Nov 2023 06:36 UTC

On 11/11/2023 9:07 pm, albert wrote:
> In article <uil4i4$2q6cm$1@dont-email.me>, dxf <dxforth@gmail.com> wrote:
>> On 10/11/2023 9:37 pm, albert wrote:
>>> [..]
>>> After (in ciforth)
>>> WANT -scripting-
>>> you can do *all* control construct in interpreter mode.
>>> (It is implicit in the -s option, for scripting)
>>>
>>> T] and T[ switch to a temporary compile area. It is typically 4 Gbyte
>>> away in a 8 Gbyte Forth, but beware of large buffers. (The same
>>> mechanism is used for classes.)
>>>
>>> Then it is one screen worth of definitions:
>>>
>>> --------------------------------------------
>>> "T]" WANTED
>>> : IF T] POSTPONE IF ; IMMEDIATE
>>> : DO T] POSTPONE DO ; IMMEDIATE
>>> : ?DO T] POSTPONE ?DO ; IMMEDIATE
>>> : BEGIN T] POSTPONE BEGIN ; IMMEDIATE
>>> : THEN POSTPONE THEN POSTPONE T[ ; IMMEDIATE
>>> : LOOP POSTPONE LOOP POSTPONE T[ ; IMMEDIATE
>>> : +LOOP POSTPONE +LOOP POSTPONE T[ ; IMMEDIATE
>>> : REPEAT POSTPONE REPEAT POSTPONE T[ ; IMMEDIATE
>>> : UNTIL POSTPONE UNTIL POSTPONE T[ ; IMMEDIATE
>>> : AGAIN POSTPONE AGAIN POSTPONE T[ ; IMMEDIATE
>>> --------------------------------------------
>>> It is insane to mint different words for this behaviour.
>>>
>>> T] and T[ is left as an exercise. Hint: they are state-smart.
>>
>> Do you have some examples? I'm still puzzled what these have over the
>> regular functions.
>>
>>
>
> A typical example is
> ( CRC64 ) CF: ?64 \ AvdH C2feb27
>
> "BOUNDS" WANTED "-scripting-" WANTED HEX
> \ Well the polynomial
> C96C,5795,D787,0F42 CONSTANT CRC64_POLYNOMIAL \ ECMA-182
> \ Auxiliary table with values for single bytes.
> CREATE CRCTable
> 100 0 DO I 8 0 DO
> DUP >R 1 RSHIFT R> 1 AND IF CRC64_POLYNOMIAL XOR THEN
> LOOP , LOOP
> \ For initial CRC and BUFFER COUNT pair, leave the updated CRC
> : CRC-MORE BOUNDS ?DO DUP I C@ XOR 0FF AND CELLS CRCTable + @
> SWAP 8 RSHIFT XOR LOOP ;
> \ For BUFFER COUNT pair, leave the CRC .
> : CRC64 -1 ROT ROT CRC-MORE INVERT ;
> DECIMAL
>
> ------------------
> Building the crc table you need not worry about a temp definition
> and whether its code land in the middle of the table you want to
> define. Also there is no entry in the dictionary that you never
> want to use again.

I've used FORGET for that but in reality a :NONAME would have done just as well.

Re: RANDOM routine pulled from an old paper

<34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25530&group=comp.lang.forth#25530

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Mon, 4 Dec 2023 09:33:10 +0000
Organization: novaBBS
Message-ID: <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3009361"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
X-Rslight-Site: $2y$10$eCntgR6/npKw6MoJC00EAOazw9QrYvXcRI/B4wEmZ8PH/qljqp5l6
 by: minforth - Mon, 4 Dec 2023 09:33 UTC

Hans Bezemer wrote:

> Maybe it is useful to someone. It seems to work just fine. I have no Forth-79 compiler to verify it.

> : ARRAY CELLS ALLOT ;

> I think it's quite obvious but anyways. The curious part is that the author seems to prefer 1-indexed arrays instead of 0-indexed ones.

> Hans Bezemer

> A Portable FORTH Random Number Generator, William T. Doyle
> The Journal of Forth Application and Research Vol. I. Number 2. Dec. 1983

> When seeded with the word RND.INIT the sequences produced are identical
> to those produced by Knuth's FORTRAN subroutine with the same seed and
> number range.

> ANS conversion by Hans Bezemer, 2023
> Converted to a single word version

I would assume that this is a heuristic RNG with unclear properties,
even though it was proposed by Knuth and has his nimbus.

As for fast pseudo RNGs, I have more faith in XOR-shift or Xo(ro)shiro.
Although not statistically perfect, Marsaglia's XOR64 is probably the shortest
and about the fastest (on 64-bit CPUs) and requires only a single state cell.

IME it is by far good enough for non-cryptographic needs.

Re: RANDOM routine pulled from an old paper

<5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25536&group=comp.lang.forth#25536

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Tue, 5 Dec 2023 08:40:50 +0000
Organization: novaBBS
Message-ID: <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3112278"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$Sss6y9UShI9EEquOlstUsOt/WoC.zGrCrFtQmSf/O3Xr5C7M.dOPG
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: minforth - Tue, 5 Dec 2023 08:40 UTC

Marsaglia XOR-shift Pseudo Random Number Generator

VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )

1 CELLS 4 = [IF] 32-bit Forth
: RND ( -- r )
(RND) @
DUP 13 LSHIFT XOR
DUP 17 RSHIFT XOR
DUP 5 LSHIFT XOR
DUP (RND) ! ;

[ELSE] 64-bit Forth
: RND ( -- r )
(RND) @
DUP 13 LSHIFT XOR
DUP 7 RSHIFT XOR
DUP 17 LSHIFT XOR
DUP (RND) ! ;

[THEN]

Re: RANDOM routine pulled from an old paper

<07301104adbc906a95a6050fa771694e@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25540&group=comp.lang.forth#25540

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Tue, 5 Dec 2023 11:04:21 +0000
Organization: novaBBS
Message-ID: <07301104adbc906a95a6050fa771694e@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com> <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3123640"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$8CYRQNPgH/3AckxY6u3.ieAchU0XGsLV0PIXhprPOOkdXOidy.93e
X-Rslight-Posting-User: 463cbf1a76c808942982a163321348c75477c065
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: mhx - Tue, 5 Dec 2023 11:04 UTC

> VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )

This will 'sporadically" fail on a transputer (signed addresses).

-marcel

Re: RANDOM routine pulled from an old paper

<65eddd46888b2908eabc5d4e638f7ed8@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25543&group=comp.lang.forth#25543

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Tue, 5 Dec 2023 12:12:20 +0000
Organization: novaBBS
Message-ID: <65eddd46888b2908eabc5d4e638f7ed8@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com> <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com> <07301104adbc906a95a6050fa771694e@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3129500"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$4Dlciy8wulhbGPC0JQcucOw8kclBfgw0CakRYzCEWQ/qmQkwuvCsi
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Posting-User: 0d6d33dbe0e2e1ff58b82acfc1a8a32ac3b1cb72
 by: minforth - Tue, 5 Dec 2023 12:12 UTC

mhx wrote:
>> VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )

> This will 'sporadically" fail on a transputer (signed addresses).

Your mulled wine must be especially good today! :o)

For even more mood enhancement:
https://www.sciencedirect.com/science/article/pii/S0377042718306265

Re: RANDOM routine pulled from an old paper

<nnd$50c9c506$5446bbc1@1e990a58aa14317d>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25545&group=comp.lang.forth#25545

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com> <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com> <07301104adbc906a95a6050fa771694e@news.novabbs.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$50c9c506$5446bbc1@1e990a58aa14317d>
Organization: KPN B.V.
Date: Tue, 05 Dec 2023 13:48:24 +0100
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 16
Injection-Date: Tue, 05 Dec 2023 13:48:24 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: none - Tue, 5 Dec 2023 12:48 UTC

In article <07301104adbc906a95a6050fa771694e@news.novabbs.com>,
mhx <mhx@iae.nl> wrote:
>> VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )
>
>This will 'sporadically" fail on a transputer (signed addresses).

Easily fixed :
VARIABLE (RND) HERE 1+ (RND) ! ( dummy seed must not be zero )
>
>-marcel
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: RANDOM routine pulled from an old paper

<6a918d19c5cc39d58834497648705326@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25551&group=comp.lang.forth#25551

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Tue, 5 Dec 2023 14:25:03 +0000
Organization: novaBBS
Message-ID: <6a918d19c5cc39d58834497648705326@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com> <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com> <07301104adbc906a95a6050fa771694e@news.novabbs.com> <nnd$50c9c506$5446bbc1@1e990a58aa14317d>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3139449"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$1sHBnmHdyJZwm.yjjasVFeiJOCJjbvvDuMjnVR/u8/KCvx5ZoPvrS
X-Rslight-Posting-User: 463cbf1a76c808942982a163321348c75477c065
 by: mhx - Tue, 5 Dec 2023 14:25 UTC

none wrote:
[..]
>>This will 'sporadically" fail on a transputer (signed addresses).

> Easily fixed :
> VARIABLE (RND) HERE 1+ (RND) ! ( dummy seed must not be zero )

??

VARIABLE (RND) HERE 1 OR (RND) !
or
CREATE (RND) 1 ,

-marcel

Re: RANDOM routine pulled from an old paper

<uko9jn$dtag$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25558&group=comp.lang.forth#25558

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!news.furie.org.uk!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxf)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Wed, 6 Dec 2023 09:52:39 +1100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uko9jn$dtag$1@dont-email.me>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com>
<34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com>
<5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com>
<07301104adbc906a95a6050fa771694e@news.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 5 Dec 2023 22:52:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7053b5ab584babb18db915e95c364f3a";
logging-data="456016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AIWyTc3WHUOfwjN3DAd4G"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dmeIDQVDptfYBwmr788Oy/vg/RM=
In-Reply-To: <07301104adbc906a95a6050fa771694e@news.novabbs.com>
Content-Language: en-GB
 by: dxf - Tue, 5 Dec 2023 22:52 UTC

On 5/12/2023 10:04 pm, mhx wrote:
>> VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )
>
> This will 'sporadically" fail on a transputer (signed addresses).

Presumably @EXECUTE and all routines that treat address 0 as a special
case would be problematic too? Perhaps it's a good thing transputers
are a forgotten technology remembered only by OT forthers :)

Re: RANDOM routine pulled from an old paper

<3cdd4162e4352b74bbd92967d389506c@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25559&group=comp.lang.forth#25559

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!.POSTED!not-for-mail
From: mhx@iae.nl (mhx)
Newsgroups: comp.lang.forth
Subject: Re: RANDOM routine pulled from an old paper
Date: Tue, 5 Dec 2023 23:34:25 +0000
Organization: novaBBS
Message-ID: <3cdd4162e4352b74bbd92967d389506c@news.novabbs.com>
References: <810d6f56-e2dc-48f8-9a81-a06588cd7e44n@googlegroups.com> <34b422991a9d3a4896d3211dbd3827ca@news.novabbs.com> <5ec43d8916060d629b6adc9b9fff36ca@news.novabbs.com> <07301104adbc906a95a6050fa771694e@news.novabbs.com> <uko9jn$dtag$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3183503"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 463cbf1a76c808942982a163321348c75477c065
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$j6HpsKGXzEOrWqDLwuCwO.pHuj.hgXg3rZE7ngoBO4X7UlrFUpviW
 by: mhx - Tue, 5 Dec 2023 23:34 UTC

dxf wrote:

> On 5/12/2023 10:04 pm, mhx wrote:
>>> VARIABLE (RND) HERE (RND) ! ( dummy seed must not be zero )
>>
>> This will 'sporadically" fail on a transputer (signed addresses).

> Presumably @EXECUTE and all routines that treat address 0 as a special
> case would be problematic too? Perhaps it's a good thing transputers
> are a forgotten technology remembered only by OT forthers :)

We noticed all that quite soon because some developers had a 16bit
transputer.

I rather like(d) the transputer ideas. Unfortunately, they failed to
deliver on their flagship T9000. On an overhead projector it was
10 times faster than an 80286.

-marcel

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor