Re: Managing custom words [Re: "Back & Forth" is back!]

Liste des GroupesRevenir à cl forth 
Sujet : Re: Managing custom words [Re: "Back & Forth" is back!]
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forth
Date : 20. Nov 2024, 11:43:35
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$14123132$15491f7d@ac45be38865b8754>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <vhij1o$1uuek$1@dont-email.me>,
Buzz McCool  <buzz_mccool@yahoo.com> wrote:
On 11/18/2024 9:28 AM, Hans Bezemer wrote:
This time, we delve into a forgotten way to handle fixed point
arithmetic. Which IMHO deserves to be dusted off now we entered the
64-bit era!
>
https://www.youtube.com/watch?v=VwPForQL10Y
>
Thanks again for the free education Hans.
>
In one of your other videos, you briefly showed a snippet of all the
custom Forth words you have created over the years.
>
I have a general question of how you and others manage custom words. Do
you "include" all these words when you start up an interactive Forth
session or do you just manually pick an choose what you want to include?
>
Any other tips on word management would be appreciated.
>

I'd say that they more properly called library words. They proved
to be useful in one application, and later be useful in other application,
simplifying the coding.

As Chuck Moore explained last international november meeting, he used
blocks for this. He has abandoned the 16 by 64 format, but he is still
numbering these blocks. A same block is loaded from vastly different
circumstances.
In my opinion it is more useful to index the block for it's content.
Instead of
178 constant prime    gcd load
I prefer
want gcd
A silly, obvious idea is to use the first line of a block that contain
conventionally the name gcd.

1. sequential search has no disadvantage in practice
2. it is obvious that in this example
   most programs don't need gcd
   all programs could need gcd
   This is typical for library facilities.
3. a block contains source not executable code
4. recursive use of want makes this feature exponentially better
5. obviously it should be idempotent, a word should be compiled once.

This is accomplished by source code less than 1 Kbyte.
It is present in ciforth since 2002.

How source blocks are organized is up to the implementer.
ciforth uses the classical 16 by 64 blocks and indexed by the first line.
After 23 years this simple idea admits a single improvement only,
multiple words loaded with one instruction.
[ I don't want to go into this, but a sequential search is actually
advantageous, organizing blocks with random access via unix `` ar ''
is less powerful. This makes it possible to have a single library
for 16/32/64 window/linux ]

Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.

Date Sujet#  Auteur
18 Nov 24 * "Back & Forth" is back!22Hans Bezemer
19 Nov 24 +* Managing custom words [Re: "Back & Forth" is back!]19Buzz McCool
20 Nov 24 i+- Re: Managing custom words [Re: "Back & Forth" is back!]1albert
22 Nov 24 i`* Re: Managing custom words [Re: "Back & Forth" is back!]17Buzz McCool
22 Nov 24 i +* Re: Managing custom words [Re: "Back & Forth" is back!]2minforth
25 Nov 24 i i`- Re: Managing custom words [Re: "Back & Forth" is back!]1Buzz McCool
25 Nov 24 i `* Re: Managing custom words [Re: "Back & Forth" is back!]14dxf
25 Nov 24 i  +* Re: Managing custom words [Re: "Back & Forth" is back!]7mhx
2 Dec 24 i  i+* Re: Managing custom words [Re: "Back & Forth" is back!]5Hans Bezemer
2 Dec 24 i  ii+* Re: Managing custom words [Re: "Back & Forth" is back!]2mhx
3 Dec 24 i  iii`- Re: Managing custom words [Re: "Back & Forth" is back!]1Hans Bezemer
3 Dec 24 i  ii`* Re: Managing custom words [Re: "Back & Forth" is back!]2albert
3 Dec 24 i  ii `- Re: Managing custom words [Re: "Back & Forth" is back!]1Hans Bezemer
3 Dec 24 i  i`- Re: Managing custom words [Re: "Back & Forth" is back!]1albert
25 Nov 24 i  +* Re: Managing custom words [Re: "Back & Forth" is back!]5albert
25 Nov 24 i  i`* Re: Managing custom words [Re: "Back & Forth" is back!]4mhx
26 Nov 24 i  i `* Re: Managing custom words [Re: "Back & Forth" is back!]3albert
26 Nov 24 i  i  `* Re: Managing custom words [Re: "Back & Forth" is back!]2mhx
27 Nov 24 i  i   `- Re: Managing custom words [Re: "Back & Forth" is back!]1dxf
3 Dec 24 i  `- Re: Managing custom words [Re: "Back & Forth" is back!]1Hans Bezemer
21 Nov 24 +- Re: "Back & Forth" is back!1Stephen Pelc
22 Nov 24 `- Re: "Back & Forth" is back!1albert

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal