Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #53683 > unrolled thread

A formal name?

Started byfoxaudioresearch@gmail.com
First post2017-01-02 18:11 -0800
Last post2017-01-03 08:16 -0800
Articles 11 — 5 participants

Back to article view | Back to comp.lang.forth


Contents

  A formal name? foxaudioresearch@gmail.com - 2017-01-02 18:11 -0800
    Re: A formal name? Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-01-03 00:13 -0500
      Re: A formal name? foxaudioresearch@gmail.com - 2017-01-02 21:58 -0800
      Re: A formal name? "Elizabeth D. Rather" <erather@forth.com> - 2017-01-02 22:05 -1000
        Re: A formal name? Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-01-03 20:25 -0500
          Re: A formal name? foxaudioresearch@gmail.com - 2017-01-04 17:10 -0800
            Re: A formal name? "Elizabeth D. Rather" <erather@forth.com> - 2017-01-04 16:20 -1000
          Re: A formal name? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-01-05 08:20 +0000
    Re: A formal name? hughaguilar96@gmail.com - 2017-01-02 21:58 -0800
    Re: A formal name? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-01-03 12:17 +0000
      Re: A formal name? foxaudioresearch@gmail.com - 2017-01-03 08:16 -0800

#53683 — A formal name?

Fromfoxaudioresearch@gmail.com
Date2017-01-02 18:11 -0800
SubjectA formal name?
Message-ID<b2ddded9-c328-4886-9bff-96208871d881@googlegroups.com>
I have been scratching my head for a name for the code words that reside in the
code field of a threaded Forth system.

They are typically called DOCOL, DOCON, DOVAR etc... and we know they reside in
the code field address, but is there a name for these words as group.

I consulted "Moving Forth" and did not see an aggregate name beyond "code fragments"

Maybe I have simply forgotten what they are called or maybe they have never been
formally named.

They are so small yet so important to a threaded system.

BF

[toc] | [next] | [standalone]


#53686

FromRod Pemberton <NeedNotReplyHere@xrsevnneqk.cem>
Date2017-01-03 00:13 -0500
Message-ID<20170103001345.71d79c23@_>
In reply to#53683
On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
foxaudioresearch@gmail.com wrote:

> I have been scratching my head for a name for the code words that
> reside in the code field of a threaded Forth system.
> 
> They are typically called DOCOL, DOCON, DOVAR etc... and we know they
> reside in the code field address, but is there a name for these words
> as group.

Also, DODOES, DOUSER, and perhaps DOLIT.

Did you mean something like "defining words" or "primitives" or
"low-level words" or "code words" ?

Did you mean something like "level 0" (fig-Forth) or
"nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?

Did you mean something like an XT?

Did you mean something like ;CODE or (;CODE) ?


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#53690

Fromfoxaudioresearch@gmail.com
Date2017-01-02 21:58 -0800
Message-ID<2264867e-2846-4bdd-9db7-0b96f9cd30d4@googlegroups.com>
In reply to#53686
On Tuesday, January 3, 2017 at 12:13:05 AM UTC-5, Rod Pemberton wrote:
> On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
> foxaudioresearch@gmail.com wrote:
> 
> > I have been scratching my head for a name for the code words that
> > reside in the code field of a threaded Forth system.
> > 
> > They are typically called DOCOL, DOCON, DOVAR etc... and we know they
> > reside in the code field address, but is there a name for these words
> > as group.
> 
> Also, DODOES, DOUSER, and perhaps DOLIT.
> 
> Did you mean something like "defining words" or "primitives" or
> "low-level words" or "code words" ?
> 
> Did you mean something like "level 0" (fig-Forth) or
> "nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?
> 
> Did you mean something like an XT?
> 
> Did you mean something like ;CODE or (;CODE) ?
> 
> 
> Rod Pemberton

Not really. These little routines are like little methods for specific data
in the Forth dictionary structure. They are a critical part of a threaded 
system. Although each one is different they all reside in the same field, 
The "CODE FIELD", but they have no name.

So they are like "ACTIONS" or "OPERATORS" or in some way, dare I say, 
"DESCRIPTORS" since you can tell what kind of a word you have by examining the
code field.

It just seems to me that as a group they need a name. With the right name, I
think threaded code explanations would be more coherent.

BF

[toc] | [prev] | [next] | [standalone]


#53696

From"Elizabeth D. Rather" <erather@forth.com>
Date2017-01-02 22:05 -1000
Message-ID<dOydnY7RA-XbxvbFnZ2dnUU7-K2dnZ2d@supernews.com>
In reply to#53686
On 1/2/17 7:13 PM, Rod Pemberton wrote:
> On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
> foxaudioresearch@gmail.com wrote:
>
>> I have been scratching my head for a name for the code words that
>> reside in the code field of a threaded Forth system.
>>
>> They are typically called DOCOL, DOCON, DOVAR etc... and we know they
>> reside in the code field address, but is there a name for these words
>> as group.
>
> Also, DODOES, DOUSER, and perhaps DOLIT.
>
> Did you mean something like "defining words" or "primitives" or
> "low-level words" or "code words" ?
>
> Did you mean something like "level 0" (fig-Forth) or
> "nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?
>
> Did you mean something like an XT?
>
> Did you mean something like ;CODE or (;CODE) ?

They are not always separate definitions, especially in optimizing 
compilers. The generic term for the code in question is "the run-time 
code for [xxx]".

Cheers,
Elizabeth

-- 
Elizabeth R. Conklin
FORTH, Inc.
6080 Center Drive, Suite 600
Los Angeles, CA  90045
USA

[toc] | [prev] | [next] | [standalone]


#53722

FromRod Pemberton <NeedNotReplyHere@xrsevnneqk.cem>
Date2017-01-03 20:25 -0500
Message-ID<20170103202548.60eda8bb@_>
In reply to#53696
On Mon, 2 Jan 2017 22:05:26 -1000
"Elizabeth D. Rather" <erather@forth.com> wrote:

> On 1/2/17 7:13 PM, Rod Pemberton wrote:
> > On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
> > foxaudioresearch@gmail.com wrote:

> >> I have been scratching my head for a name for the code words that
> >> reside in the code field of a threaded Forth system.
> >>
> >> They are typically called DOCOL, DOCON, DOVAR etc... and we know
> >> they reside in the code field address, but is there a name for
> >> these words as group.  
> >
> > Also, DODOES, DOUSER, and perhaps DOLIT.
> >
> > Did you mean something like "defining words" or "primitives" or
> > "low-level words" or "code words" ?
> >
> > Did you mean something like "level 0" (fig-Forth) or
> > "nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?
> >
> > Did you mean something like an XT?
> >
> > Did you mean something like ;CODE or (;CODE) ?  
> 
> They are not always separate definitions, especially in optimizing 
> compilers. The generic term for the code in question is "the run-time 
> code for [xxx]".
> 

So, it seems that there is a subtle distinction between "primitives"
and either "run-time code for [xxx]" or "run-time routines for
non-primitives".  It seems that "primitives" are only single-use
run-time code, while the "doers", or "generic actions", can be used
repeatedly.  Is that correct?

If so, that's an interesting distinction.  I've been referring to both
as "primitives".  The "doers", while they are *used* multiple times in
my low-level code (17 DOVAR, 7 DOCON, 11 DOCOL as ENTER), their
run-time routines are *implemented* as code only once, just like the
code for primitives with single-use run-time code, e.g., DUP DROP ADD
SUB, etc.


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#53744

Fromfoxaudioresearch@gmail.com
Date2017-01-04 17:10 -0800
Message-ID<4c2692b5-c3d2-4751-b3ae-23f6ccd42bc5@googlegroups.com>
In reply to#53722
On Tuesday, January 3, 2017 at 8:25:07 PM UTC-5, Rod Pemberton wrote:
> On Mon, 2 Jan 2017 22:05:26 -1000
> "Elizabeth D. Rather" <erather@forth.com> wrote:
> 
> > On 1/2/17 7:13 PM, Rod Pemberton wrote:
> > > On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
> > > foxaudioresearch@gmail.com wrote:
> 
> > >> I have been scratching my head for a name for the code words that
> > >> reside in the code field of a threaded Forth system.
> > >>
> > >> They are typically called DOCOL, DOCON, DOVAR etc... and we know
> > >> they reside in the code field address, but is there a name for
> > >> these words as group.  
> > >
> > > Also, DODOES, DOUSER, and perhaps DOLIT.
> > >
> > > Did you mean something like "defining words" or "primitives" or
> > > "low-level words" or "code words" ?
> > >
> > > Did you mean something like "level 0" (fig-Forth) or
> > > "nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?
> > >
> > > Did you mean something like an XT?
> > >
> > > Did you mean something like ;CODE or (;CODE) ?  
> > 
> > They are not always separate definitions, especially in optimizing 
> > compilers. The generic term for the code in question is "the run-time 
> > code for [xxx]".
> > 
> 
> So, it seems that there is a subtle distinction between "primitives"
> and either "run-time code for [xxx]" or "run-time routines for
> non-primitives".  It seems that "primitives" are only single-use
> run-time code, while the "doers", or "generic actions", can be used
> repeatedly.  Is that correct?
> 
> If so, that's an interesting distinction.  I've been referring to both
> as "primitives".  The "doers", while they are *used* multiple times in
> my low-level code (17 DOVAR, 7 DOCON, 11 DOCOL as ENTER), their
> run-time routines are *implemented* as code only once, just like the
> code for primitives with single-use run-time code, e.g., DUP DROP ADD
> SUB, etc.
> 
> 
> Rod Pemberton

I am no sure we are saying the same exactly the same thing so here's my take.

To my thinking "primitives" are Forth words that at written in the lowest level
language of the Forth system.

They are stand alone Forth words used to write programs, but in a threaded 
system, they have no "threaded code" only machine code (or whatever is the lowest level code) 

Some books have called these words  "primaries"

DOVAR DOCOL etc... are special. They are "PRIMITIVES" yes. But they are not
words that you use when programming. They are part of the guts of the system.

They are used by the compiler to construct "high-level" Forth words. These high
level words are  sometimes called "Secondaries".  Secondaries are built out of 
Primaries.  Secondaries also always have on of these special "DOERS" as part of
their structure.

Example of a secondary word: (obvious, but I am on a roll here) ;)  

: BOUNDS    OVER + SWAP ;  

Bounds has no machine code internally, except a little "DOER".
OVER, + and SWAP are coded at the machine level so they are "primaries".  
This is all just for for clarity on my thinking.

The cool thing about the "DOERS" is that in a language with NO formal type
system, each DOER imbues a kind of "TYPE" to the words that use them.

That could direct us on a search for a better name.

It might be my latent academic coming out, but "DOERS" to me sounds like a
lazy choice for the name of these little beasties, yet it persists so it is the
lead.

I did a little brainstorming and came up with these possibilities:

Single Word Candidates:

ENCUMBENT: "DOERS"

  "HANDLERS"
  "RUNNERS"
  "EXECUTORS"
  "DIRECTORS"
  "INSTRUCTORS"
  "COMMANDERS"
  "PRESCRIPTORS"
  "SPECIES"
  "TYPES"
  "GENUS"
  "RUBRICS"

Compound Word Candidates:
  "EXECUTION-CODE"
  "TYPE-CODE"
  "CLASS-CODE"
  "WORD-HANDLERS"
  "THREAD-HANDLERS"
  "WORD-TYPE"
  "WORD-CODE"

At the end of the day maybe nobody cares very much, but a better name helps
explain a threaded system for the newbies.

my 2 cents (CAD, about 1.4 USD)

BF

[toc] | [prev] | [next] | [standalone]


#53745

From"Elizabeth D. Rather" <erather@forth.com>
Date2017-01-04 16:20 -1000
Message-ID<5dSdnWGiJN3PMPDFnZ2dnUU7-dXNnZ2d@supernews.com>
In reply to#53744
On 1/4/17 3:10 PM, foxaudioresearch@gmail.com wrote:
> On Tuesday, January 3, 2017 at 8:25:07 PM UTC-5, Rod Pemberton wrote:
>> On Mon, 2 Jan 2017 22:05:26 -1000
>> "Elizabeth D. Rather" <erather@forth.com> wrote:
>>
>>> On 1/2/17 7:13 PM, Rod Pemberton wrote:
>>>> On Mon, 2 Jan 2017 18:11:38 -0800 (PST)
>>>> foxaudioresearch@gmail.com wrote:
>>
>>>>> I have been scratching my head for a name for the code words that
>>>>> reside in the code field of a threaded Forth system.
>>>>>
>>>>> They are typically called DOCOL, DOCON, DOVAR etc... and we know
>>>>> they reside in the code field address, but is there a name for
>>>>> these words as group.
>>>>
>>>> Also, DODOES, DOUSER, and perhaps DOLIT.
>>>>
>>>> Did you mean something like "defining words" or "primitives" or
>>>> "low-level words" or "code words" ?
>>>>
>>>> Did you mean something like "level 0" (fig-Forth) or
>>>> "nucleus" (Forth-79 and Forth-83) or "core" (DPANS94)?
>>>>
>>>> Did you mean something like an XT?
>>>>
>>>> Did you mean something like ;CODE or (;CODE) ?
>>>
>>> They are not always separate definitions, especially in optimizing
>>> compilers. The generic term for the code in question is "the run-time
>>> code for [xxx]".
>>>
>>
>> So, it seems that there is a subtle distinction between "primitives"
>> and either "run-time code for [xxx]" or "run-time routines for
>> non-primitives".  It seems that "primitives" are only single-use
>> run-time code, while the "doers", or "generic actions", can be used
>> repeatedly.  Is that correct?
>>
>> If so, that's an interesting distinction.  I've been referring to both
>> as "primitives".  The "doers", while they are *used* multiple times in
>> my low-level code (17 DOVAR, 7 DOCON, 11 DOCOL as ENTER), their
>> run-time routines are *implemented* as code only once, just like the
>> code for primitives with single-use run-time code, e.g., DUP DROP ADD
>> SUB, etc.
>>
>>
>> Rod Pemberton
>
> I am no sure we are saying the same exactly the same thing so here's my take.
>
> To my thinking "primitives" are Forth words that at written in the lowest level
> language of the Forth system.
>
> They are stand alone Forth words used to write programs, but in a threaded
> system, they have no "threaded code" only machine code (or whatever is the lowest level code)

Of course, one threaded system will use code for a different set of 
words than another, depending on implementer priorities. DUP is probably 
always a primitive, but MOVE might not be.

> Some books have called these words  "primaries"
>
> DOVAR DOCOL etc... are special. They are "PRIMITIVES" yes. But they are not
> words that you use when programming. They are part of the guts of the system.

Yes, and they are sometimes high-level, not code. They are executed by 
programming words such as : DO IF etc.

> They are used by the compiler to construct "high-level" Forth words. These high
> level words are  sometimes called "Secondaries".  Secondaries are built out of
> Primaries.  Secondaries also always have on of these special "DOERS" as part of
> their structure.
>
> Example of a secondary word: (obvious, but I am on a roll here) ;)
>
> : BOUNDS    OVER + SWAP ;
>
> Bounds has no machine code internally, except a little "DOER".
> OVER, + and SWAP are coded at the machine level so they are "primaries".
> This is all just for for clarity on my thinking.
>
> The cool thing about the "DOERS" is that in a language with NO formal type
> system, each DOER imbues a kind of "TYPE" to the words that use them.
>
> That could direct us on a search for a better name.
>
> It might be my latent academic coming out, but "DOERS" to me sounds like a
> lazy choice for the name of these little beasties, yet it persists so it is the
> lead.
>
> I did a little brainstorming and came up with these possibilities:
>
> Single Word Candidates:
>
> ENCUMBENT: "DOERS"
>
>   "HANDLERS"
>   "RUNNERS"
>   "EXECUTORS"
>   "DIRECTORS"
>   "INSTRUCTORS"
>   "COMMANDERS"
>   "PRESCRIPTORS"
>   "SPECIES"
>   "TYPES"
>   "GENUS"
>   "RUBRICS"
>
> Compound Word Candidates:
>   "EXECUTION-CODE"
>   "TYPE-CODE"
>   "CLASS-CODE"
>   "WORD-HANDLERS"
>   "THREAD-HANDLERS"
>   "WORD-TYPE"
>   "WORD-CODE"
>
> At the end of the day maybe nobody cares very much, but a better name helps
> explain a threaded system for the newbies.

You can come up with a term to distinguish words implemented in code 
from words written in high-level Forth, but the sets of words in each 
category will vary widely across implementations. Or, you can come up 
with words whose run-time behavior is compiled by compiler directives 
(e.g. LOOP) or defining words (e.g., : ) assuming you aren't trying to 
distinguish whether they were written in code or not. FWIW, the FORTH, 
Inc. convention for naming the latter category is the compiler word in 
parens (e.g., LOOP compiles a call to (LOOP) along with its compiler 
activities).



-- 
Elizabeth R. Conklin
FORTH, Inc.
6080 Center Drive, Suite 600
Los Angeles, CA  90045
USA

[toc] | [prev] | [next] | [standalone]


#53747

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2017-01-05 08:20 +0000
Message-ID<2017Jan5.092052@mips.complang.tuwien.ac.at>
In reply to#53722
Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> writes:
>So, it seems that there is a subtle distinction between "primitives"
>and either "run-time code for [xxx]" or "run-time routines for
>non-primitives".  It seems that "primitives" are only single-use
>run-time code, while the "doers", or "generic actions", can be used
>repeatedly.  Is that correct?

I think the main difference is that primitives are words, and these
run-time routines are not.  In a Forth/assembler implementation of
Forth, primitives are defined with CODE, and these run-time routines
are the code behind ;CODE.

If a system has words for these routines (e.g., DOCOL:, DOVAR: etc. in
Gforth), these words don't execute the routine, unlike for primitives,
because executing these routines don't make sense on their own;
instead, such words typically produce the address of the routine, and
are used for building non-primitives.

Concerning the term "secondaries", the way I have seen it used is for
colon definitions.  That's why I use "non-primitives" for the class of
words that use these run-time routines.

- 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 2016: http://www.euroforth.org/ef16/

[toc] | [prev] | [next] | [standalone]


#53691

Fromhughaguilar96@gmail.com
Date2017-01-02 21:58 -0800
Message-ID<92027ed5-9a16-41a1-b3bd-dd905394dede@googlegroups.com>
In reply to#53683
On Monday, January 2, 2017 at 7:11:40 PM UTC-7, foxaudio...@gmail.com wrote:
> I have been scratching my head for a name for the code words that reside in the
> code field of a threaded Forth system.
> 
> They are typically called DOCOL, DOCON, DOVAR etc... and we know they reside in
> the code field address, but is there a name for these words as group.
> 
> I consulted "Moving Forth" and did not see an aggregate name beyond "code fragments"
> 
> Maybe I have simply forgotten what they are called or maybe they have never been
> formally named.
> 
> They are so small yet so important to a threaded system.
> 
> BF

I call them doers.

[toc] | [prev] | [next] | [standalone]


#53700

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2017-01-03 12:17 +0000
Message-ID<2017Jan3.131744@mips.complang.tuwien.ac.at>
In reply to#53683
foxaudioresearch@gmail.com writes:
>I have been scratching my head for a name for the code words that reside in the
>code field of a threaded Forth system.
>
>They are typically called DOCOL, DOCON, DOVAR etc... and we know they reside in
>the code field address, but is there a name for these words as group.

I don't think there has ever been a well-established term for that.

In the Gforth engine source code the comment calls them "run-time
routines for non-primitives".  Elsewhere the term "doer" occurs, and
that has also been proposed by someone else, so that may be a good
name for this class of routines.

- 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 2016: http://www.euroforth.org/ef16/

[toc] | [prev] | [next] | [standalone]


#53705

Fromfoxaudioresearch@gmail.com
Date2017-01-03 08:16 -0800
Message-ID<8dad0e85-13f6-424b-97dd-3fe5bb2dfe4a@googlegroups.com>
In reply to#53700
On Tuesday, January 3, 2017 at 7:25:02 AM UTC-5, Anton Ertl wrote:
> foxaudioresearch@gmail.com writes:
> >I have been scratching my head for a name for the code words that reside in the
> >code field of a threaded Forth system.
> >
> >They are typically called DOCOL, DOCON, DOVAR etc... and we know they reside in
> >the code field address, but is there a name for these words as group.
> 
> I don't think there has ever been a well-established term for that.
> 
> In the Gforth engine source code the comment calls them "run-time
> routines for non-primitives".  Elsewhere the term "doer" occurs, and
> that has also been proposed by someone else, so that may be a good
> name for this class of routines.
> 
> - 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 2016: http://www.euroforth.org/ef16/


So we have phrases:
 
"run-time code for xxxx"  
"run-time routines for non-primitives"

These are good descriptions but not a name.

We have the word "DOERS" in common usage which goes back
to ancient times with the DOER/MAKE words that have been replaced by DEFER 
et al...


These choices are not satisfying to me. But DOERS might be the best we have.
Remember I am involved in marketing communication so forgive me, but good names
are important. It's a Forth principle too.

I will consult a thesaurus and see what other words might be appropriate and
if others have suggestions please put them here as well. A short compound word
could work also.

For background I have written a cross-compiler in a literate programming
style for teaching purposes. This is when I realized I wanted a name for
all these little routines but didn't have a good one.

BF

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web