Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

No directory.


devel / comp.lang.forth / Forth dictionary headers

SubjectAuthor
* Forth dictionary headersnone
+- Re: Forth dictionary headersMarcel Hendrix
+- Re: Forth dictionary headersminf...@arcor.de
`- Re: Forth dictionary headersAnton Ertl

1
Forth dictionary headers

<nnd$755e341b$5d06f4cf@95425999c357ad57>

 copy mid

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

 copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Forth dictionary headers
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$755e341b$5d06f4cf@95425999c357ad57>
Organization: KPN B.V.
Date: Tue, 12 Apr 2022 09:25:43 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.roellig-ltd.de!open-news-network.org!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 44
Injection-Date: Tue, 12 Apr 2022 09:25:43 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2325
 by: none - Tue, 12 Apr 2022 07:25 UTC

An indirect threaded Forth header contains the following elements:
CFA : contains the address to jump to during EXECUTE
DFA : is a pointer to mutable data, in rare cases a constant
FFA : contains flags, properties of the word
LFA : identifies the wordlist, probably linking
NFA : Address of where the name of the word resides
SFA : Optional:identifies the source

These fields are constant. They need never be changed
once the word is created. It is amenable to be placed
in flash.

A VARIABLE and a BUFFER contains a pointer to
after the header or to an area in mutable RAM.
Though the content changes, the pointer needs not to.

Comes CREATE. The standard requires that there are two
mutable areas involved CREATE.
- DOES> identifies the action to be done by the CREATEd words
ISO require that it is possible to redefine indefinitely.
- The data field in the ISO sense. This is the run of the
mill data and is by nature mutable.
This is easily accommodated with a pointer to RAM that
contains two fields.

Implementors may choose this system to separate the immutable and the
mutable fields over baroque ad hoc headers where special cases
abound. Demanding that a CONSTANT is a CREATEd items,
is reminiscent of Java where even a simple integer is an object,
imposing overhead where it is no necessary.

[These insight came to me AD 2001. My impression is that
Ting, implementing a Forth in C++ comes to similar conclusions.]

P.S.
Code Data Link Flag Name Source
Note that this is in alphabetic order, as well of the
order of importance.
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Forth dictionary headers

<b9ae8d79-1724-4480-b9b9-f5fd71109c82n@googlegroups.com>

 copy mid

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

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1b14:b0:2ed:2383:c5dd with SMTP id bb20-20020a05622a1b1400b002ed2383c5ddmr2327208qtb.564.1649749887105;
Tue, 12 Apr 2022 00:51:27 -0700 (PDT)
X-Received: by 2002:a05:622a:46:b0:2e1:d837:e91d with SMTP id
y6-20020a05622a004600b002e1d837e91dmr2298726qtw.633.1649749885677; Tue, 12
Apr 2022 00:51:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!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: Tue, 12 Apr 2022 00:51:25 -0700 (PDT)
In-Reply-To: <nnd$755e341b$5d06f4cf@95425999c357ad57>
Injection-Info: google-groups.googlegroups.com; posting-host=176.74.235.101; posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 176.74.235.101
References: <nnd$755e341b$5d06f4cf@95425999c357ad57>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b9ae8d79-1724-4480-b9b9-f5fd71109c82n@googlegroups.com>
Subject: Re: Forth dictionary headers
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Tue, 12 Apr 2022 07:51:27 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 14
 by: Marcel Hendrix - Tue, 12 Apr 2022 07:51 UTC

On Tuesday, April 12, 2022 at 9:25:48 AM UTC+2, none albert wrote:
> An indirect threaded Forth header contains the following elements:
[..]
> SFA : Optional:identifies the source
[..]

The SFA is unlikely to be a constant, e.g. the source might be on
a network drive and the user accesses it from various accounts on
various operating systems, over a period of many years (i.e.
hardware revisions).

In iForth, we "install" the kernel sources, and the database of SFAs
for user source codes is dynamically adjusted/rebuild when loading.

-marcel

Re: Forth dictionary headers

<ecf4f419-4148-4563-873c-acc1b5c1f26bn@googlegroups.com>

 copy mid

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

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4512:b0:67d:52fc:4792 with SMTP id t18-20020a05620a451200b0067d52fc4792mr2219821qkp.458.1649750953528;
Tue, 12 Apr 2022 01:09:13 -0700 (PDT)
X-Received: by 2002:a37:2e42:0:b0:67e:6d80:2707 with SMTP id
u63-20020a372e42000000b0067e6d802707mr2223636qkh.365.1649750953378; Tue, 12
Apr 2022 01:09:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!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: Tue, 12 Apr 2022 01:09:13 -0700 (PDT)
In-Reply-To: <nnd$755e341b$5d06f4cf@95425999c357ad57>
Injection-Info: google-groups.googlegroups.com; posting-host=79.224.111.239; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 79.224.111.239
References: <nnd$755e341b$5d06f4cf@95425999c357ad57>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ecf4f419-4148-4563-873c-acc1b5c1f26bn@googlegroups.com>
Subject: Re: Forth dictionary headers
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Tue, 12 Apr 2022 08:09:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: minf...@arcor.de - Tue, 12 Apr 2022 08:09 UTC

none albert schrieb am Dienstag, 12. April 2022 um 09:25:48 UTC+2:

> Implementors may choose this system to separate the immutable and the
> mutable fields over baroque ad hoc headers where special cases
> abound. Demanding that a CONSTANT is a CREATEd items,
> is reminiscent of Java where even a simple integer is an object,
> imposing overhead where it is no necessary.

Constants need not be CREATEd necessarily. However the Forth compiler
must know its value somehow. For this introspection CREATE is a cheap way.

Re: Forth dictionary headers

<2022Apr12.105014@mips.complang.tuwien.ac.at>

 copy mid

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

 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: Forth dictionary headers
Date: Tue, 12 Apr 2022 08:50:14 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 59
Message-ID: <2022Apr12.105014@mips.complang.tuwien.ac.at>
References: <nnd$755e341b$5d06f4cf@95425999c357ad57>
Injection-Info: reader02.eternal-september.org; posting-host="441397f7d199c44b694ed5c2421d39c7";
logging-data="17549"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pwwe8IPPilWB9fm3pC3Zw"
Cancel-Lock: sha1:cSA2z+C2D99mW0ylTk9i8v9A1b0=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Tue, 12 Apr 2022 08:50 UTC

albert@cherry.(none) (albert) writes:
>An indirect threaded Forth header contains the following elements:
>CFA : contains the address to jump to during EXECUTE
>DFA : is a pointer to mutable data, in rare cases a constant
>FFA : contains flags, properties of the word
>LFA : identifies the wordlist, probably linking
>NFA : Address of where the name of the word resides
>SFA : Optional:identifies the source
>
>These fields are constant. They need never be changed
>once the word is created.

The only thing specific to indirect threading is the code field (and
with code separated from headers you a code field is a good idea even
on a native-code system.

Flags are changed with IMMEDIATE, and on SMUDGE systems with SMUDGE.

On REVEAL systems the link field is changed on REVEAL.

Systems tend to use either SMUDGE or REVEAL (any exceptions?).

>Comes CREATE. The standard requires that there are two
>mutable areas involved CREATE.
>- DOES> identifies the action to be done by the CREATEd words
> ISO require that it is possible to redefine indefinitely.
>- The data field in the ISO sense. This is the run of the
>mill data and is by nature mutable.
>This is easily accommodated with a pointer to RAM that
>contains two fields.

Which means one indirection more for implementing dodoes.
Direct-to-flash systems have preferred to put the does-action address
into flash, foregoing standards compliance.

One thing to note is that IMMEDIATE, DOES>, and the unsmudging or
revealing of the current word all happen in Forth-2012 before the next
word is defined (locals and (non-2012) quotations muddle the picture a
little), so you can construct the current header in RAM, and create it
in flash when starting the next header. Issues: How to implement
RECURSE, ' and FIND (of the most recently defined word); anything
else?

>Demanding that a CONSTANT is a CREATEd items,
>is reminiscent of Java where even a simple integer is an object,
>imposing overhead where it is no necessary.

Actually Java has so-called base types (e.g., int and long), which are
not objects. Many of the things you can do with objects you cannot do
with base types. Therefore Java also has a class Integer which boxes
int up as object (including object overhead), so you can use it where
an object is expected (e.g., with the collection classes).

- 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

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor