Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A year spent in artificial intelligence is enough to make one believe in God.


devel / comp.lang.forth / Re: Strings and 24-bit cells

SubjectAuthor
* Strings and 24-bit cellsBrad Eckert
+* Re: Strings and 24-bit cellsMarcel Hendrix
|`- Re: Strings and 24-bit cellsBrad Eckert
+- Re: Strings and 24-bit cellsminf...@arcor.de
`* Re: Strings and 24-bit cellsMatthias Koch
 `- Re: Strings and 24-bit cellsBrad Eckert

1
Strings and 24-bit cells

<b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:2483:b0:4bb:59ec:c5a7 with SMTP id gi3-20020a056214248300b004bb59ecc5a7mr7745107qvb.94.1667145359814;
Sun, 30 Oct 2022 08:55:59 -0700 (PDT)
X-Received: by 2002:a81:500a:0:b0:36c:13d5:b516 with SMTP id
e10-20020a81500a000000b0036c13d5b516mr8833548ywb.70.1667145359620; Sun, 30
Oct 2022 08:55:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 30 Oct 2022 08:55:59 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=72.217.63.66; posting-account=6GCGIQoAAAAyO8IjR_VTwqiqLwx0Q_G8
NNTP-Posting-Host: 72.217.63.66
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
Subject: Strings and 24-bit cells
From: hwfw...@gmail.com (Brad Eckert)
Injection-Date: Sun, 30 Oct 2022 15:55:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2046
 by: Brad Eckert - Sun, 30 Oct 2022 15:55 UTC

I'm contemplating a Forth machine with 24-bit cells that pack three 8-bit chars per cell. Data memory would consist of three byte-lanes. Rather than use modulo 3 addressing, I would use modulo 4 which behaves like a typical 32-bit Forth (4 bytes/cell) but with the fourth byte-lane missing. Accessing any byte address whose two LSBs are "11" would be an ambiguous condition.

I think this is workable if the starting addresses of strings are cell-aligned. Then CELLS would have a reference point for its math. CELL+ would be easy: If it results in an invalid address, do 1+ again.

The most important thing is testability, which any 32-bit Forth can be adapted to. Char operators can test for invalid char addresses.

So, this breaks the assumption that char addressing is monotonic but it is not a show stopper nor does it break backward compatibility. The 24-bit code will still run in a 32-bit environment.

There are sure to be some caveats, which is what I am asking about. Any thoughts?

Re: Strings and 24-bit cells

<4acfa35c-d649-4c07-89c5-1297f25d540bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:ca6:b0:4bb:6ec1:abd8 with SMTP id s6-20020a0562140ca600b004bb6ec1abd8mr7767489qvs.62.1667148868073;
Sun, 30 Oct 2022 09:54:28 -0700 (PDT)
X-Received: by 2002:a81:6554:0:b0:349:8e3:a882 with SMTP id
z81-20020a816554000000b0034908e3a882mr9028470ywb.388.1667148867922; Sun, 30
Oct 2022 09:54:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 30 Oct 2022 09:54:27 -0700 (PDT)
In-Reply-To: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.30.53.30; posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 84.30.53.30
References: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4acfa35c-d649-4c07-89c5-1297f25d540bn@googlegroups.com>
Subject: Re: Strings and 24-bit cells
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 30 Oct 2022 16:54:28 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1642
 by: Marcel Hendrix - Sun, 30 Oct 2022 16:54 UTC

On Sunday, October 30, 2022 at 4:56:01 PM UTC+1, Brad Eckert wrote:
[..]
> There are sure to be some caveats, which is what I am asking about. Any thoughts?

I assume you have sound technical reasons for this.
The first iForth's were specific for a segmented architecture (32 address bits, upper
16 indicated the segment). It worked well, but eventually I got tired of the
non-standardness of the scheme and scrapped the idea.

Do you think your idea will survive (i.e. be worthwile) 10 years from now (or even 2)?

-marcel

Re: Strings and 24-bit cells

<0e825f8d-fec3-46eb-9a50-fb87507fc82cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:63c4:0:b0:6fa:23a2:9fc6 with SMTP id x187-20020a3763c4000000b006fa23a29fc6mr4931620qkb.376.1667223448796;
Mon, 31 Oct 2022 06:37:28 -0700 (PDT)
X-Received: by 2002:a25:a288:0:b0:6ca:e3de:ae75 with SMTP id
c8-20020a25a288000000b006cae3deae75mr12986998ybi.391.1667223448623; Mon, 31
Oct 2022 06:37:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 31 Oct 2022 06:37:28 -0700 (PDT)
In-Reply-To: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=87.157.106.215; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 87.157.106.215
References: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e825f8d-fec3-46eb-9a50-fb87507fc82cn@googlegroups.com>
Subject: Re: Strings and 24-bit cells
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Mon, 31 Oct 2022 13:37:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2720
 by: minf...@arcor.de - Mon, 31 Oct 2022 13:37 UTC

Brad Eckert schrieb am Sonntag, 30. Oktober 2022 um 16:56:01 UTC+1:
> I'm contemplating a Forth machine with 24-bit cells that pack three 8-bit chars per cell. Data memory would consist of three byte-lanes. Rather than use modulo 3 addressing, I would use modulo 4 which behaves like a typical 32-bit Forth (4 bytes/cell) but with the fourth byte-lane missing. Accessing any byte address whose two LSBs are "11" would be an ambiguous condition..
>
> I think this is workable if the starting addresses of strings are cell-aligned. Then CELLS would have a reference point for its math. CELL+ would be easy: If it results in an invalid address, do 1+ again.
>
> The most important thing is testability, which any 32-bit Forth can be adapted to. Char operators can test for invalid char addresses.
>
> So, this breaks the assumption that char addressing is monotonic but it is not a show stopper nor does it break backward compatibility. The 24-bit code will still run in a 32-bit environment.
>
> There are sure to be some caveats, which is what I am asking about. Any thoughts?

Seems ok as long as you are "providing" all strings. But it can lead to moving strings or substrings
around if they are read in from external sources or data streams.
Of course this would not be the case when all you do is use a string-aligned buffer.
BTW AFAIK Ocaml uses (or used to use) bit 0 to distinguish pointers from integers.
When you have an FPU, nan-boxing is an old technique.

Re: Strings and 24-bit cells

<tjp0sp$hpj0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: m.c...@gmx.net (Matthias Koch)
Newsgroups: comp.lang.forth
Subject: Re: Strings and 24-bit cells
Date: Mon, 31 Oct 2022 18:33:13 +0100
Organization: A noiseless patient Spider
Lines: 2
Message-ID: <tjp0sp$hpj0$1@dont-email.me>
References: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 31 Oct 2022 17:33:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="123ce197d77b764ab80e121568c0821e";
logging-data="583264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9cSYr1/qC0YgNFG17qqoj"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.0
Cancel-Lock: sha1:9Hq5/u8rXzW2h/XPfn81UCWAVCs=
Content-Language: de-DE
In-Reply-To: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com>
 by: Matthias Koch - Mon, 31 Oct 2022 17:33 UTC

One interesting idea would be to design a word-addressed machine, and provide primitives to fetch/store a variable amount of bits or bytes starting from a native word address unit. With this in place, one could in theory resynthesise and recompile both processor HDL and Forth core for an arbitrary Forth cell width.

Re: Strings and 24-bit cells

<f9094df3-9110-4e49-ae79-f92f85ed64f2n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:450:b0:39d:9a0:3b with SMTP id o16-20020a05622a045000b0039d09a0003bmr20099656qtx.213.1667401896366;
Wed, 02 Nov 2022 08:11:36 -0700 (PDT)
X-Received: by 2002:a05:6902:1509:b0:6ca:9a5f:7c4 with SMTP id
q9-20020a056902150900b006ca9a5f07c4mr24801083ybu.81.1667401896143; Wed, 02
Nov 2022 08:11:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 2 Nov 2022 08:11:35 -0700 (PDT)
In-Reply-To: <tjp0sp$hpj0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=72.217.63.66; posting-account=6GCGIQoAAAAyO8IjR_VTwqiqLwx0Q_G8
NNTP-Posting-Host: 72.217.63.66
References: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com> <tjp0sp$hpj0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f9094df3-9110-4e49-ae79-f92f85ed64f2n@googlegroups.com>
Subject: Re: Strings and 24-bit cells
From: hwfw...@gmail.com (Brad Eckert)
Injection-Date: Wed, 02 Nov 2022 15:11:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 29
 by: Brad Eckert - Wed, 2 Nov 2022 15:11 UTC

On Monday, October 31, 2022 at 10:33:15 AM UTC-7, Matthias Koch wrote:
> One interesting idea would be to design a word-addressed machine, and provide primitives to fetch/store a variable amount of bits or bytes starting from a native word address unit. With this in place, one could in theory resynthesise and recompile both processor HDL and Forth core for an arbitrary Forth cell width.

Consider Chuck Moore's processor designs. Did he ever support byte addressing? I don't think so. They were all word-addressed (CELL+ same as 1+). Even the Sh-BOOM was word-addressed, with hardware support for packing and unpacking bytes (up to 4 bytes).

ANS assigns a relationship between cell and char addresses. If cell units and char units are not equivalent, the strings paradigm may be broken. You are allowed to mix a-addr and c-addr. That is a dependency. You shouldn't be using @ and ! on a c-addr or C@ and C! on a c-addr. But you can do it and ANS Forth will not complain. It breaks the "crash early and crash often" rule.

One could have a third address type, bf-addr, which would address bit fields. Due to the limited cell address range (most bits are the mask size and shift count) it would be used with data structures. How to imply the base address of the data structure in a reentrant way is a topic for discussion. You could use a double for bf-addr (unwieldy), a separate base address stack, keep the base address on the return stack (breaking ANS stack rules), or just use a static variable and forget about reentrancy.

I can only speculate about Chuck's insistence on word addressing, but I would chalk it up to his aversion to cargo cult programming. Perhaps that is the reason he hated ANS.

Re: Strings and 24-bit cells

<c0a52fbe-6ec2-460d-9565-0e2c62c67dfdn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:20c1:b0:4b9:f285:de7e with SMTP id 1-20020a05621420c100b004b9f285de7emr21529729qve.14.1667402754105;
Wed, 02 Nov 2022 08:25:54 -0700 (PDT)
X-Received: by 2002:a05:6902:1009:b0:6ca:bc92:6ac0 with SMTP id
w9-20020a056902100900b006cabc926ac0mr23951628ybt.237.1667402753861; Wed, 02
Nov 2022 08:25:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 2 Nov 2022 08:25:53 -0700 (PDT)
In-Reply-To: <4acfa35c-d649-4c07-89c5-1297f25d540bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=72.217.63.66; posting-account=6GCGIQoAAAAyO8IjR_VTwqiqLwx0Q_G8
NNTP-Posting-Host: 72.217.63.66
References: <b1b731c4-b084-4b86-b75a-8ed20673e3d9n@googlegroups.com> <4acfa35c-d649-4c07-89c5-1297f25d540bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0a52fbe-6ec2-460d-9565-0e2c62c67dfdn@googlegroups.com>
Subject: Re: Strings and 24-bit cells
From: hwfw...@gmail.com (Brad Eckert)
Injection-Date: Wed, 02 Nov 2022 15:25:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2498
 by: Brad Eckert - Wed, 2 Nov 2022 15:25 UTC

On Sunday, October 30, 2022 at 9:54:29 AM UTC-7, Marcel Hendrix wrote:
> On Sunday, October 30, 2022 at 4:56:01 PM UTC+1, Brad Eckert wrote:
> [..]
> > There are sure to be some caveats, which is what I am asking about. Any thoughts?
> I assume you have sound technical reasons for this.
> The first iForth's were specific for a segmented architecture (32 address bits, upper
> 16 indicated the segment). It worked well, but eventually I got tired of the
> non-standardness of the scheme and scrapped the idea.
>
> Do you think your idea will survive (i.e. be worthwile) 10 years from now (or even 2)?
>
> -marcel
Nope, no sound technical reasons. But that's okay, I am tilting toward word addressing anyway. I like Sh-BOOM's handling of octets.

Sh-BOOM did not survive either. It was amazingly good for its time. It offered high performance for a fraction of the cost of other designs of similar capability. But, it was too different and it did not have the marketing support. The support needed to market a microprocessor is extraordinary. Such a product launch needs all kinds of software support, application engineering, and of course a sales team. It's not just a case of building a better mousetrap.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor