Discussion:
Toad revisits Quan
(too old to reply)
sjack
2024-08-05 04:18:54 UTC
Permalink
Had some notes from long back for building QUAN and VECT using DOES>
exploits from examples in Baranoff papers (no surviving link). Apparently
the Forth I had then had the same type of CREATE DOES> that with
DOES> exploits could produce words with multiple CFAs.
I decided to do the same in TOAD, a FigForth derivative, which
<BUILD DOES> have CFA followed by a vector. The result was
words with multiple vectors and helpers that used ENTER instead of
EXECUTE. But then I found QUAN could be easily built without
exploits. It reduced to a simple VALUE with the same TO but only
without any type checks (could be added). However, I think the point
of the Baranoff papers was not so much about what it takes to build
QUAN but how DOES> exploits work and how they might be used which
I did find informative and interesting.

In a nut shell, DOES> exploits add small words that begin with DOES>
followed by a small silver of code:
: FOO does> ... ;
When executed in a defining word, they provide alternate execution
paths available for helper words (these paths are not compiled into the
the defining words but are taken from these exploit words directly).
Also, the defining word has access to the defined word's CFA therefore
a link to the defined word's data field address, DFA , if needed.

Those DOES> exploit words remind me of mRNA bringing in component material
for functioning of the DNA in building proteins (which used to be
a good thing).
a***@spenarnc.xs4all.nl
2024-08-05 10:10:56 UTC
Permalink
Post by sjack
Had some notes from long back for building QUAN and VECT using DOES>
exploits from examples in Baranoff papers (no surviving link). Apparently
the Forth I had then had the same type of CREATE DOES> that with
DOES> exploits could produce words with multiple CFAs.
I decided to do the same in TOAD, a FigForth derivative, which
<BUILD DOES> have CFA followed by a vector. The result was
words with multiple vectors and helpers that used ENTER instead of
EXECUTE. But then I found QUAN could be easily built without
exploits. It reduced to a simple VALUE with the same TO but only
without any type checks (could be added). However, I think the point
of the Baranoff papers was not so much about what it takes to build
QUAN but how DOES> exploits work and how they might be used which
I did find informative and interesting.
In a nut shell, DOES> exploits add small words that begin with DOES>
: FOO does> ... ;
When executed in a defining word, they provide alternate execution
paths available for helper words (these paths are not compiled into the
the defining words but are taken from these exploit words directly).
Also, the defining word has access to the defined word's CFA therefore
a link to the defined word's data field address, DFA , if needed.
Those DOES> exploit words remind me of mRNA bringing in component material
for functioning of the DNA in building proteins (which used to be
a good thing).
For a practical approach using multiple DOES>-like fields see
the one screen OO class definitions in ciforth.
The first thing you must loose is the notion that DOES> .. ;
is a good syntac for what you want to accomplish.

If has proven its worth with manx (controlling mechanical instruments)
and ciasdis (reverse engineering assembler/disassembler.)

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 purring. - the Wise from Antrim -
Loading...