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


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

What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth

Started byJUERGEN <epldfpga@aol.com>
First post2015-03-17 12:47 -0700
Last post2015-03-26 06:34 +0000
Articles 20 on this page of 68 — 17 participants

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


Contents

  What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth JUERGEN <epldfpga@aol.com> - 2015-03-17 12:47 -0700
    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-17 22:29 +0100
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-18 10:59 +0000
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 12:04 +0100
          Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-18 11:19 +0000
            Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 12:39 +0100
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Elizabeth D. Rather" <erather@forth.com> - 2015-03-18 08:05 -1000
                Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-18 18:34 +0000
                Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 20:05 +0100
    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-03-17 19:11 -0400
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-19 00:28 -0400
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth rickman <gnuarm@gmail.com> - 2015-03-20 01:00 -0400
    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 11:33 +0100
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-18 22:15 +0100
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-19 07:53 +0100
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth visualforth@rocketmail.com - 2015-03-19 17:17 -0700
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth rickman <gnuarm@gmail.com> - 2015-03-20 01:01 -0400
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-18 18:42 -0400
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Alex McDonald" <blog@rivadpm.com> - 2015-03-18 23:56 +0000
          Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-19 02:46 +0100
            Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Alex McDonald" <blog@rivadpm.com> - 2015-03-19 09:27 +0000
          Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-18 22:21 -0400
            Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Alex McDonald" <blog@rivadpm.com> - 2015-03-19 09:43 +0000
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-20 02:09 -0400
                Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Alex McDonald" <blog@rivadpm.com> - 2015-03-20 15:41 +0000
                  Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-29 16:23 -0400
                    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth rickman <gnuarm@gmail.com> - 2015-03-29 16:43 -0400
                    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Alex McDonald" <blog@rivadpm.com> - 2015-03-29 22:53 +0100
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-19 08:00 +0100
          Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-20 02:09 -0400
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-20 14:43 +0100
        ...Tiny targets Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-03-23 15:26 +0100
          Re: ...Tiny targets Paul Rubin <no.email@nospam.invalid> - 2015-03-23 10:39 -0700
          Re: ...Tiny targets JUERGEN <epldfpga@aol.com> - 2015-03-24 01:18 -0700
            Re: ...Tiny targets Paul Rubin <no.email@nospam.invalid> - 2015-03-24 17:45 -0700
              Re: ...Tiny targets JUERGEN <epldfpga@aol.com> - 2015-03-25 00:08 -0700
                Re: ...Tiny targets Paul Rubin <no.email@nospam.invalid> - 2015-03-25 00:43 -0700
                  Re: ...Tiny targets Gary Bergstrom <forthprgrmr@gmail.com> - 2015-03-25 07:07 -0700
                    Re: ...Tiny targets Paul Rubin <no.email@nospam.invalid> - 2015-03-25 08:06 -0700
                      Re: ...Tiny targets rickman <gnuarm@gmail.com> - 2015-03-25 15:19 -0400
                        Re: ...Tiny targets Paul Rubin <no.email@nospam.invalid> - 2015-03-25 12:39 -0700
                        Re: ...Tiny targets Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-25 20:42 +0100
                          Re: ...Tiny targets rickman <gnuarm@gmail.com> - 2015-03-25 16:41 -0400
                          Re: ...Tiny targets hughaguilar96@gmail.com - 2015-03-25 22:32 -0700
                            Re: ...Tiny targets "Alex McDonald" <blog@rivadpm.com> - 2015-03-26 09:35 +0000
                              Re: ...Tiny targets Ron Aaron <rambamist@gmail.com> - 2015-03-26 14:52 +0200
                              Re: ...Tiny targets rickman <gnuarm@gmail.com> - 2015-03-27 16:12 -0400
                            Re: ...Tiny targets albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-26 13:00 +0000
                          Re: ...Tiny targets anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-26 11:58 +0000
                  Re: ...Tiny targets JUERGEN <epldfpga@aol.com> - 2015-03-25 07:10 -0700
                  Re: ...Tiny targets JUERGEN <epldfpga@aol.com> - 2015-03-25 07:16 -0700
              Re: ...Tiny targets Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-03-27 13:01 +0100
    Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Gary Bergstrom <forthprgrmr@gmail.com> - 2015-03-18 06:45 -0700
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth JUERGEN <epldfpga@aol.com> - 2015-03-18 08:57 -0700
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 20:09 +0100
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth JUERGEN <epldfpga@aol.com> - 2015-03-18 08:59 -0700
      Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth hughaguilar96@gmail.com - 2015-03-20 21:47 -0700
        Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth JUERGEN <epldfpga@aol.com> - 2015-03-21 02:30 -0700
          Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth hughaguilar96@gmail.com - 2015-03-21 17:52 -0700
            Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth JUERGEN <epldfpga@aol.com> - 2015-03-22 01:27 -0700
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth hughaguilar96@gmail.com - 2015-03-22 13:15 -0700
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth hughaguilar96@gmail.com - 2015-03-22 13:47 -0700
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth rickman <gnuarm@gmail.com> - 2015-03-22 18:39 -0400
              Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth hughaguilar96@gmail.com - 2015-03-22 16:32 -0700
              Re: What is the minimum Word set you could live with to have a(limping) Beginner's ANS Forth "WJ" <w_a_x_man@yahoo.com> - 2015-03-26 06:35 +0000
                Re: What is the minimum Word set you could live with to have a(limping) Beginner's ANS Forth rickman <gnuarm@gmail.com> - 2015-03-27 15:55 -0400
                  Re: What is the minimum Word set you could live with to have a(limping) Beginner's ANS Forth "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-03-28 03:36 -0400
            Re: What is the minimum Word set you could live with to have a(limping) Beginner's ANS Forth "WJ" <w_a_x_man@yahoo.com> - 2015-03-26 06:34 +0000

Page 1 of 4  [1] 2 3 4  Next page →


#37348 — What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth

FromJUERGEN <epldfpga@aol.com>
Date2015-03-17 12:47 -0700
SubjectWhat is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth
Message-ID<09b0d52b-de4f-4805-9cc1-fc1cc0499ac3@googlegroups.com>
Ting       34 WORDS       
Brinkhoff  12
Pilchota   17
B16        43
B16SMALL   40
GA_F18     45

I hope we got the numbers right 
- otherwise please correct and we will change the ExCel tables.

But for a project we would like to have a list of words that fit into 4 bits 
- so 16 words max to be used.

Any good suggestions?

And NO, we do not want to reinvent Forth. 
The rest of the words can stay there for later.

If you go on holiday to country X you might buy a little booklet at the airport to communicate with the locals (Forthers?), 
you definitely will not walk around with the Oxford Dictionary of the full word set ...

[toc] | [next] | [standalone]


#37357

FromBernd Paysan <bernd.paysan@gmx.de>
Date2015-03-17 22:29 +0100
Message-ID<mea6av$7il$1@dont-email.me>
In reply to#37348
JUERGEN wrote:

> Ting       34 WORDS
> Brinkhoff  12
> Pilchota   17
> B16        43
> B16SMALL   40
> GA_F18     45

These minimalistic Forth CPUs have a small amount of instructions, but they 
are already a compromise between "fast" and "small".  Several of those 
instructions are not actual Forth words, but useful factors like 
multiplication and division step.

And these are instructions, so they don't include words like : or VARIABLE, 
nor IF, THEN, BEGIN, UNTIL or so.  There's no 1:1 relation between these 
words and the minimum amount of words you need for a useful system.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*

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


#37382

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2015-03-18 10:59 +0000
Message-ID<55095a87$0$3069$e4fe514c@dreader35.news.xs4all.nl>
In reply to#37357
In article <mea6av$7il$1@dont-email.me>,
Bernd Paysan  <bernd.paysan@gmx.de> wrote:
>JUERGEN wrote:
>
>> Ting       34 WORDS
>> Brinkhoff  12
>> Pilchota   17
>> B16        43
>> B16SMALL   40
>> GA_F18     45
>
>These minimalistic Forth CPUs have a small amount of instructions, but they
>are already a compromise between "fast" and "small".  Several of those
>instructions are not actual Forth words, but useful factors like
>multiplication and division step.
>
>And these are instructions, so they don't include words like : or VARIABLE,
>nor IF, THEN, BEGIN, UNTIL or so.  There's no 1:1 relation between these
>words and the minimum amount of words you need for a useful system.

I also want to remark that the least amount of code words doesn't
equal "simplest" nor even "easiest to port". With the goal of simplest in
mind, I arrive at yourforth, with 70 to 80 code words.

Obsession with the number of code words reminds me of
those stupid managers who prefer bug fixes that change
the least amount of lines, over a more thorough fix of
underlying defects.

>
>--
>Bernd Paysan
>

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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


#37383

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2015-03-18 12:04 +0100
Message-ID<85h9tiin2a.fsf@junk.nocrew.org>
In reply to#37382
Albert van der Horstd writes:
> I also want to remark that the least amount of code words doesn't
> equal "simplest" nor even "easiest to port". With the goal of
> simplest in mind, I arrive at yourforth, with 70 to 80 code words.

Can you elaborate on that?  Perhaps a few examples of where you prefer
a CODE definition over a colon definition?

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


#37387

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2015-03-18 11:19 +0000
Message-ID<55095f34$0$3069$e4fe514c@dreader35.news.xs4all.nl>
In reply to#37383
In article <85h9tiin2a.fsf@junk.nocrew.org>,
Lars Brinkhoff  <lars.spam@nocrew.org> wrote:
>Albert van der Horstd writes:
>> I also want to remark that the least amount of code words doesn't
>> equal "simplest" nor even "easiest to port". With the goal of
>> simplest in mind, I arrive at yourforth, with 70 to 80 code words.
>
>Can you elaborate on that?  Perhaps a few examples of where you prefer
>a CODE definition over a colon definition?

You could reduce all comparisons to <. That is not simple.
You need one code word say < at least. In an 8086 you need
a particular trick in moving a flag to a cell, and you have to
explain that in detail. So there is no way around expending the
effort, as there is no way around having code words.
Once someone understands that, words like > <= <> 0<> are just more of
the same.

I too started out with FIG-Forth like
: > SWAP < ;
Studying jonesforth made me aware of how silly that really is.

(Of course `` : >SWAP < ; '' is easier to port, but it is not simpler. )

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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


#37389

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2015-03-18 12:39 +0100
Message-ID<858ueuilf7.fsf@junk.nocrew.org>
In reply to#37387
albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>>> I also want to remark that the least amount of code words doesn't
>>> equal "simplest" nor even "easiest to port".
>>
>>Can you elaborate on that?  Perhaps a few examples of where you
>>prefer a CODE definition over a colon definition?
>
> You could reduce all comparisons to <. That is not simple.

Right, e.g. implementing U< in terms of < may not make for a simpler
system overall.

> You need one code word say < at least.

(Parenthetical remark:  Strictly speaking it's not necessary.  You can
build it from other arithmetic/logic operations.)

> I too started out with FIG-Forth like
> : > SWAP < ;
> Studying jonesforth made me aware of how silly that really is.

I don't understand.  How is that one-liner not simpler than a CODE
definition for >?  Not that I necessarily disagree with you, I just
ask you to explain in more detail.  I'm looking at jonesforth right
now, and it's not apparent to me what your getting at.

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


#37404

From"Elizabeth D. Rather" <erather@forth.com>
Date2015-03-18 08:05 -1000
Message-ID<FKCdnfSFBPf-I5TInZ2dnUU7-S2dnZ2d@supernews.com>
In reply to#37389
On 3/18/15 1:39 AM, Lars Brinkhoff wrote:
> albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>>>> I also want to remark that the least amount of code words doesn't
>>>> equal "simplest" nor even "easiest to port".
>>>
>>> Can you elaborate on that?  Perhaps a few examples of where you
>>> prefer a CODE definition over a colon definition?
>>
>> You could reduce all comparisons to <. That is not simple.
>
> Right, e.g. implementing U< in terms of < may not make for a simpler
> system overall.
>
>> You need one code word say < at least.
>
> (Parenthetical remark:  Strictly speaking it's not necessary.  You can
> build it from other arithmetic/logic operations.)
>
>> I too started out with FIG-Forth like
>> : > SWAP < ;
>> Studying jonesforth made me aware of how silly that really is.
>
> I don't understand.  How is that one-liner not simpler than a CODE
> definition for >?  Not that I necessarily disagree with you, I just
> ask you to explain in more detail.  I'm looking at jonesforth right
> now, and it's not apparent to me what your getting at.

Because the code definition is also a one-liner, probably only a couple 
of instructions, and way faster in an ITC Forth than calling SWAP and <.

The most important instances deal with compiler directives (structure 
words, DOES> and things of that sort, which are can be very short code 
definitions but tortuous to do in high level without access to the 
underlying VM.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

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


#37405

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2015-03-18 18:34 +0000
Message-ID<5509c52a$0$23199$e4fe514c@dreader34.news.xs4all.nl>
In reply to#37404
In article <FKCdnfSFBPf-I5TInZ2dnUU7-S2dnZ2d@supernews.com>,
Elizabeth D. Rather <erather@forth.com> wrote:
>On 3/18/15 1:39 AM, Lars Brinkhoff wrote:
>> albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>>>>> I also want to remark that the least amount of code words doesn't
>>>>> equal "simplest" nor even "easiest to port".
>>>>
>>>> Can you elaborate on that?  Perhaps a few examples of where you
>>>> prefer a CODE definition over a colon definition?
>>>
>>> You could reduce all comparisons to <. That is not simple.
>>
>> Right, e.g. implementing U< in terms of < may not make for a simpler
>> system overall.
>>
>>> You need one code word say < at least.
>>
>> (Parenthetical remark:  Strictly speaking it's not necessary.  You can
>> build it from other arithmetic/logic operations.)
>>
>>> I too started out with FIG-Forth like
>>> : > SWAP < ;
>>> Studying jonesforth made me aware of how silly that really is.
>>
>> I don't understand.  How is that one-liner not simpler than a CODE
>> definition for >?  Not that I necessarily disagree with you, I just
>> ask you to explain in more detail.  I'm looking at jonesforth right
>> now, and it's not apparent to me what your getting at.
>
>Because the code definition is also a one-liner, probably only a couple
>of instructions, and way faster in an ITC Forth than calling SWAP and <.

What I tried to convey is that it is similar to > , such that it is not
an extra brainload. What is an extra brain load is the question
why is < lowlevel and > lowlevel.

>
>The most important instances deal with compiler directives (structure
>words, DOES> and things of that sort, which are can be very short code
>definitions but tortuous to do in high level without access to the
>underlying VM.

A good example of this is also SM/REM. It is a single instruction in
the 8086, and basing it on UM/MOD is very contorted.

>
>Cheers,
>Elizabeth
>
>--
>==================================================
>Elizabeth D. Rather   (US & Canada)   800-55-FORTH
>FORTH Inc.                         +1 310.999.6784
>5959 West Century Blvd. Suite 700
>Los Angeles, CA 90045
>http://www.forth.com
>
>"Forth-based products and Services for real-time
>applications since 1973."
>==================================================
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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


#37406

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2015-03-18 20:05 +0100
Message-ID<85pp86gm8x.fsf@junk.nocrew.org>
In reply to#37404
"Elizabeth D. Rather" <erather@forth.com> writes:
>>> I too started out with FIG-Forth like
>>> : > SWAP < ;
>>> Studying jonesforth made me aware of how silly that really is.
>>
>> I don't understand.  How is that one-liner not simpler than a CODE
>> definition for >?
>
> Because the code definition is also a one-liner, probably only a
> couple of instructions, and way faster in an ITC Forth than calling
> SWAP and <.

I agree a code definition is superior in most ways.  I just don't see
how it's simpler.  Maybe it's something about the word "simpler".

> The most important instances deal with compiler directives (structure
> words, DOES> and things of that sort, which are can be very short code
> definitions but tortuous to do in high level without access to the
> underlying VM.

Having done those sorts of things, I wholly agree they are probably
simpler in CODE.

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


#37363

From"Rod Pemberton" <buzz@notnotnontnooatno.cmm>
Date2015-03-17 19:11 -0400
Message-ID<op.xvnz1ra1v6dtjm@localhost>
In reply to#37348
On Tue, 17 Mar 2015 15:47:17 -0400, JUERGEN <epldfpga@aol.com> wrote:

> Ting       34 WORDS
> Brinkhoff  12
> Pilchota   17
> B16        43
> B16SMALL   40
> GA_F18     45

Please note the misspelling of Plichota.

C.H. Ting is eForth.
Lars Brinkhoff is lbForth.
Vic Plichota is v4th.
B16 and B16Small, I assume, are Bernd Paysan's ...
GA_F18 is GreenArrays F18.

> I hope we got the numbers right - otherwise please correct and
> we will change the ExCel tables.
>
> But for a project we would like to have a list of words that
> fit into 4 bits - so 16 words max to be used.
>
> Any good suggestions?
>
> And NO, we do not want to reinvent Forth.
> The rest of the words can stay there for later.
>
> If you go on holiday to country X you might buy a little
> booklet at the airport to communicate with the locals
> (Forthers?), you definitely will not walk around with
> the Oxford Dictionary of the full word set ...

The issue of the optimal wordset with different constraints,
e.g., minimal, usable, fast, effective, etc has been discussed
a number of times in the past on comp.lang.forth.

It's a matter of how primitive you want to go.  (pun intended)
A primitive (or low-level) Forth word is what does the work.
for Forths that build up their colon definitions from a small
wordset.  This design trend started with C.H. Ting's eForth.
Primitives are the minimal unit of functionality.  You either
can't factor them anymore, or shouldn't if you don't want your
Forth to be exceptionally slow.  E.g., stack words, arithmetic,
logical operations, bitwise operations, etc.  Typically, a
usable Forth wordset is from 23 to 63, but can range from 9
to 2500 words

E.g., this minimal wordset which comprises about half (50%)
of my set of primitives in my Forth, and is near thirty total:

stack operations
DUP DROP SWAP OVER ROT >R R>

branching
BRANCH ?BRANCH

@ ! C@ C!

arithmetic
+ - * /

comparison
< > 0= 0>

bitwise
AND OR XOR

stack pointers
RP SP DP

I/O
KEY EMIT .

bootstrapping words...
LIT ,

Of course, if you throw out a bunch, say OVER ROT C@ C! * /
0> < RP SP DP and add NOT, you've still got 21 of them ...
How do you get rid of another 5 or so?

E.g., I posted this some years ago which lists the primitive
counts for a total 20 Forths and Forth standards, as well as
the primitives used by a few Forths.  Among the list of
primities, it has two sets of 9 minimal bootstrap words.
It's at the end of my post after my name.  The link may take
to you one of Brad Eckert's post.  Mine is after that.

https://groups.google.com/d/msg/comp.lang.forth/KHw28PKZXUk/JrXcjrYshxAJ

You might want to look at Mikael Patel's Minimal Forth Machine
which has 9 primitives and was posted years ago to comp.lang.forth.
This post of mine has links:

https://groups.google.com/d/msg/comp.lang.forth/BxvCjAs4s9g/LZ4-7e8hfHMJ

As for being ANS, you'll need to pick the ANS equivalents.  Most
are named the same.  You're not going to find some things you need
in ANS Core or ANS Core Ext such as LIT BRANCH ?BRANCH etc.


Rod Pemberton

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


#37422

From"Rod Pemberton" <bork@lllljunkqwer.cpm>
Date2015-03-19 00:28 -0400
Message-ID<op.xvp9c7otwa0t4m@localhost>
In reply to#37363
On Tue, 17 Mar 2015 19:11:41 -0400, Rod Pemberton  
<buzz@notnotnontnooatno.cmm> wrote:
> On Tue, 17 Mar 2015 15:47:17 -0400, JUERGEN <epldfpga@aol.com> wrote:

>> Ting       34 WORDS
>> Brinkhoff  12
>> Pilchota   17
>> B16        43
>> B16SMALL   40
>> GA_F18     45
>
> Please note the misspelling of Plichota.
>
> C.H. Ting is eForth.
> Lars Brinkhoff is lbForth.
> Vic Plichota is v4th.
> B16 and B16Small, I assume, are Bernd Paysan's ...
> GA_F18 is GreenArrays F18.
>
>> I hope we got the numbers right - otherwise please correct and
>> we will change the ExCel tables.
>>
>> But for a project we would like to have a list of words that
>> fit into 4 bits - so 16 words max to be used.
>>
>> Any good suggestions?
>>
>> And NO, we do not want to reinvent Forth.
>> The rest of the words can stay there for later.
>>
>> If you go on holiday to country X you might buy a little
>> booklet at the airport to communicate with the locals
>> (Forthers?), you definitely will not walk around with
>> the Oxford Dictionary of the full word set ...
>
> The issue of the optimal wordset with different constraints,
> e.g., minimal, usable, fast, effective, etc has been discussed
> a number of times in the past on comp.lang.forth.
>
> It's a matter of how primitive you want to go.  (pun intended)
> A primitive (or low-level) Forth word is what does the work.
> for Forths that build up their colon definitions from a small
> wordset.  This design trend started with C.H. Ting's eForth.
> Primitives are the minimal unit of functionality.  You either
> can't factor them anymore, or shouldn't if you don't want your
> Forth to be exceptionally slow.  E.g., stack words, arithmetic,
> logical operations, bitwise operations, etc.  Typically, a
> usable Forth wordset is from 23 to 63, but can range from 9
> to 2500 words
>
> E.g., this minimal wordset which comprises about half (50%)
> of my set of primitives in my Forth, and is near thirty total:
>
> stack operations
> DUP DROP SWAP OVER ROT >R R>
>
> branching
> BRANCH ?BRANCH
>
> @ ! C@ C!
>
> arithmetic
> + - * /
>
> comparison
> < > 0= 0>
>
> bitwise
> AND OR XOR
>
> stack pointers
> RP SP DP
>
> I/O
> KEY EMIT .
>
> bootstrapping words...
> LIT ,
>
> Of course, if you throw out a bunch, say OVER ROT C@ C! * /
> 0> < RP SP DP and add NOT, you've still got 21 of them ...
> How do you get rid of another 5 or so?
>
> E.g., I posted this some years ago which lists the primitive
> counts for a total 20 Forths and Forth standards, as well as
> the primitives used by a few Forths.  Among the list of
> primities, it has two sets of 9 minimal bootstrap words.
> It's at the end of my post after my name.  The link may take
> to you one of Brad Eckert's post.  Mine is after that.
>
> https://groups.google.com/d/msg/comp.lang.forth/KHw28PKZXUk/JrXcjrYshxAJ
>
> You might want to look at Mikael Patel's Minimal Forth Machine
> which has 9 primitives and was posted years ago to comp.lang.forth.
> This post of mine has links:
>
> https://groups.google.com/d/msg/comp.lang.forth/BxvCjAs4s9g/LZ4-7e8hfHMJ
>
> As for being ANS, you'll need to pick the ANS equivalents.  Most
> are named the same.  You're not going to find some things you need
> in ANS Core or ANS Core Ext such as LIT BRANCH ?BRANCH etc.
>

 From Koopman's instruction frequencies, you might use these:

DOCOL EXIT @ C@ + = R> >R DUP SWAP ROT AND LIT 0BRANCH BRANCH

 From Anton Ertl's "peep" superinstruction data, you could try
using these for additional low-level words:

0= ! OVER CELLS 2DUP +! R@ <> C! /MOD DROP CELL+ - LSHIFT NIP ?DUP 2DROP

Koopman's
http://users.ece.cmu.edu/~koopman/stack_computers/sec6_3.html

Ertl's
http://www.complang.tuwien.ac.at/forth/peep/


Rod Pemberton


-- 
Cars kill more people than guns in the U.S.
Yet, no one is trying to take away your car.

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


#37454

Fromrickman <gnuarm@gmail.com>
Date2015-03-20 01:00 -0400
Message-ID<meg9fc$u7r$1@dont-email.me>
In reply to#37422
On 3/19/2015 12:28 AM, Rod Pemberton wrote:
>
>  From Koopman's instruction frequencies, you might use these:
>
> DOCOL EXIT @ C@ + = R> >R DUP SWAP ROT AND LIT 0BRANCH BRANCH
>
>  From Anton Ertl's "peep" superinstruction data, you could try
> using these for additional low-level words:
>
> 0= ! OVER CELLS 2DUP +! R@ <> C! /MOD DROP CELL+ - LSHIFT NIP ?DUP 2DROP
>
> Koopman's
> http://users.ece.cmu.edu/~koopman/stack_computers/sec6_3.html
>
> Ertl's
> http://www.complang.tuwien.ac.at/forth/peep/

I would suggest that the most common Forth primitives used in existing 
code might not be the same thing as the best primitives for an 
instruction set.  The instruction sets of most CPUs designed to run 
Forth or something like Forth are not, in fact, the same as these 
primitives.

That said, these analyses do give an idea of what operations are most 
often used when running Forth and therefore the operations that need to 
be done efficiently by the instruction set, just not necessarily the 
same way as the primitives.  For example, the F18A in the GA144 does not 
have a SWAP instruction.  Turns out it is a small limitation and in 
fact, improves the design of some low level code doing subtractions.

-- 

Rick

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


#37380

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2015-03-18 11:33 +0100
Message-ID<85lhiuioif.fsf@junk.nocrew.org>
In reply to#37348
JUERGEN <epldfpga@aol.com> wrote:
>> But for a project we would like to have a list of words that
>> fit into 4 bits - so 16 words max to be used.
>> Any good suggestions?

My suggestion might be:

Definitions:          dodoes exit
Control flow:         0branch
Literals:             (literal)
Memory access:        ! @ c! c@
Aritmetic/logic:      + nand
Return stack:         >r r>

Of course, c! and c@ may be optional if you're content with cell-sized
characters.  I experimented with removing 0branch, (literal), >r, and
r>, but the resulting system became orders of magnitude slower.

Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
access to the stack pointers: SP@, SP!, RP@, RP!.

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


#37409

FromBernd Paysan <bernd.paysan@gmx.de>
Date2015-03-18 22:15 +0100
Message-ID<mecpr3$5j3$2@dont-email.me>
In reply to#37380
Lars Brinkhoff wrote:

> JUERGEN <epldfpga@aol.com> wrote:
>>> But for a project we would like to have a list of words that
>>> fit into 4 bits - so 16 words max to be used.
>>> Any good suggestions?
> 
> My suggestion might be:
> 
> Definitions:          dodoes exit
> Control flow:         0branch
> Literals:             (literal)
> Memory access:        ! @ c! c@
> Aritmetic/logic:      + nand
> Return stack:         >r r>
> 
> Of course, c! and c@ may be optional if you're content with cell-sized
> characters.  I experimented with removing 0branch, (literal), >r, and
> r>, but the resulting system became orders of magnitude slower.
> 
> Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
> access to the stack pointers: SP@, SP!, RP@, RP!.

No, you don't, variable+@/! is sufficient to implement stack operations:

variable a
variable b
: swap  a ! b ! a @ b @ ;

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*

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


#37425

FromLars Brinkhoff <lars.spam@nocrew.org>
Date2015-03-19 07:53 +0100
Message-ID<85a8z9h410.fsf@junk.nocrew.org>
In reply to#37409
Bernd Paysan wrote:
> Lars Brinkhoff wrote:
>> Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
>> access to the stack pointers: SP@, SP!, RP@, RP!.
>
> No, you don't, variable+@/! is sufficient to implement stack operations:
>
> variable a
> variable b
> : swap  a ! b ! a @ b @ ;

No, they are not needed in the minimal set.  I was suggesting
additional primitives to reach 16, which was the OP's target.

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


#37448

Fromvisualforth@rocketmail.com
Date2015-03-19 17:17 -0700
Message-ID<317d8ca3-fb30-4345-a3fc-af65426ea16e@googlegroups.com>
In reply to#37409
On Wednesday, March 18, 2015 at 5:15:01 PM UTC-4, Bernd Paysan wrote:
> Lars Brinkhoff wrote:
> 
> > JUERGEN <epldfpga.com> wrote:
> >>> But for a project we would like to have a list of words that
> >>> fit into 4 bits - so 16 words max to be used.
> >>> Any good suggestions?
> > 
> > My suggestion might be:
> > 
> > Definitions:          dodoes exit
> > Control flow:         0branch
> > Literals:             (literal)
> > Memory access:        ! @ c! c@
> > Aritmetic/logic:      + nand
> > Return stack:         >r r>
> > 
> > Of course, c! and c@ may be optional if you're content with cell-sized
> > characters.  I experimented with removing 0branch, (literal), >r, and
> > r>, but the resulting system became orders of magnitude slower.
> > 
> > Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
> > access to the stack pointers: SP@, SP!, RP@, RP!.
> 
> No, you don't, variable+@/! is sufficient to implement stack operations:
> 
> variable a
> variable b
> : swap  a ! b ! a @ b @ ;
> 
> -- 
> Bernd Paysan
> "If you want it done right, you have to do it yourself"
> http://bernd-paysan.de/
> net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*

That's a good start into the right direction!
Thinking outside the box!
Thanks, Bernd!

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


#37455

Fromrickman <gnuarm@gmail.com>
Date2015-03-20 01:01 -0400
Message-ID<meg9i4$u7r$2@dont-email.me>
In reply to#37409
On 3/18/2015 5:15 PM, Bernd Paysan wrote:
> Lars Brinkhoff wrote:
>
>> JUERGEN <epldfpga@aol.com> wrote:
>>>> But for a project we would like to have a list of words that
>>>> fit into 4 bits - so 16 words max to be used.
>>>> Any good suggestions?
>>
>> My suggestion might be:
>>
>> Definitions:          dodoes exit
>> Control flow:         0branch
>> Literals:             (literal)
>> Memory access:        ! @ c! c@
>> Aritmetic/logic:      + nand
>> Return stack:         >r r>
>>
>> Of course, c! and c@ may be optional if you're content with cell-sized
>> characters.  I experimented with removing 0branch, (literal), >r, and
>> r>, but the resulting system became orders of magnitude slower.
>>
>> Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
>> access to the stack pointers: SP@, SP!, RP@, RP!.
>
> No, you don't, variable+@/! is sufficient to implement stack operations:
>
> variable a
> variable b
> : swap  a ! b ! a @ b @ ;

Or just put them on the stack in the right order in the first place. 
That is the most common approach in F18A code I believe.

-- 

Rick

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


#37413

From"Rod Pemberton" <bork@lllljunkqwer.cpm>
Date2015-03-18 18:42 -0400
Message-ID<op.xvptc4bjwa0t4m@localhost>
In reply to#37380
On Wed, 18 Mar 2015 06:33:12 -0400, Lars Brinkhoff <lars.spam@nocrew.org>
wrote:
> JUERGEN <epldfpga@aol.com> wrote:

>>> But for a project we would like to have a list of words that
>>> fit into 4 bits - so 16 words max to be used.
>>> Any good suggestions?
>
> My suggestion might be:
>
> Definitions:          dodoes exit
> Control flow:         0branch
> Literals:             (literal)
> Memory access:        ! @ c! c@
> Aritmetic/logic:      + nand
> Return stack:         >r r>
>
> Of course, c! and c@ may be optional if you're content with cell-sized
> characters.  I experimented with removing 0branch, (literal), >r, and
> r>, but the resulting system became orders of magnitude slower.
>
> Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
> access to the stack pointers: SP@, SP!, RP@, RP!.

As my other post indicates, it's going to be hard to live with only
16 primitive (or low-level) words maximum.

So, he might be interested in a shift-state.  E.g., perhaps an instruction
could be used to shift between two sets of 16 words.  That would provide
a total of 30 words, not including the shift word in both states/sets.


Rod Pemberton

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


#37417

From"Alex McDonald" <blog@rivadpm.com>
Date2015-03-18 23:56 +0000
Message-ID<med394$e5d$1@dont-email.me>
In reply to#37413
on 18/03/2015 22:42:31, "Rod Pemberton" wrote:
> On Wed, 18 Mar 2015 06:33:12 -0400, Lars Brinkhoff
> <lars.spam@nocrew.org> wrote:
>> JUERGEN <epldfpga@aol.com> wrote:
> 
>>>> But for a project we would like to have a list of words that
>>>> fit into 4 bits - so 16 words max to be used.
>>>> Any good suggestions?
>>
>> My suggestion might be:
>>
>> Definitions:          dodoes exit
>> Control flow:         0branch
>> Literals:             (literal)
>> Memory access:        ! @ c! c@
>> Aritmetic/logic:      + nand
>> Return stack:         >r r>
>>
>> Of course, c! and c@ may be optional if you're content with cell-sized
>> characters.  I experimented with removing 0branch, (literal), >r, and
>> r>, but the resulting system became orders of magnitude slower.
>>
>> Add to this some of DUP, SWAP, OVER, DROP, 0<, etc.  Or maybe you need
>> access to the stack pointers: SP@, SP!, RP@, RP!.
> 
> As my other post indicates, it's going to be hard to live with only
> 16 primitive (or low-level) words maximum.
> 
> So, he might be interested in a shift-state. E.g., perhaps an
> instruction could be used to shift between two sets of 16 words. That
> would provide a total of 30 words, not including the shift word in
> both states/sets.
> 
> 
> Rod Pemberton
> 

Shifting state has its own problems. A word expects a certain state for
the tokens it will execute. There is one workable option; save the state
on entry to each word, set the required state, and restore on exit. Needs
a stack of states; possibly on the return stack. That would double the
size of the stack required, assuming cell-sized states.

Either way, the extra overhead is burdensome. It has parallels with shift
character encoding issues, and those are neatly solved by (for example)
UTF-8. That would suggest a 4 bit encoding somewhat like this (note I
haven't checked this for correctness);

0xxx                8 codes
100x 11xx           8 codes
1010 11xx 11xx      16 codes
1011 11xx 11xx 11xx 64 codes

It's self aligning; we can always work out instruction boundaries
backwards or forwards even though they are variable length. No state is
required, and longer sequences can be used for less frequent operations.

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


#37419

FromBernd Paysan <bernd.paysan@gmx.de>
Date2015-03-19 02:46 +0100
Message-ID<med9oq$14c$1@dont-email.me>
In reply to#37417
Alex McDonald wrote:
> Shifting state has its own problems. A word expects a certain state for
> the tokens it will execute. There is one workable option; save the state
> on entry to each word, set the required state, and restore on exit. Needs
> a stack of states; possibly on the return stack. That would double the
> size of the stack required, assuming cell-sized states.
> 
> Either way, the extra overhead is burdensome. It has parallels with shift
> character encoding issues, and those are neatly solved by (for example)
> UTF-8. That would suggest a 4 bit encoding somewhat like this (note I
> haven't checked this for correctness);
> 
> 0xxx                8 codes
> 100x 11xx           8 codes
> 1010 11xx 11xx      16 codes
> 1011 11xx 11xx 11xx 64 codes
> 
> It's self aligning; we can always work out instruction boundaries
> backwards or forwards even though they are variable length. No state is
> required, and longer sequences can be used for less frequent operations.

If you want less overhead, adopt protobuf variable length encoding.  Reduced 
to 4 bits per symbol, that would be:

0xxx                   8 codes
1xxx 0xxx             64 codes
1xxx 1xxx 0xxx       512 codes
1xxx 1xxx 1xxx 0xxx 4096 codes

The "disadvantge" of protobuf compared to UTF-8 is that the first symbol 
does not denote the entire length of the complete token.  But it is a denser 
encoding, so overall, it's a win.

We could have an ASCII-compatible UTF-protobuf, as well.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*

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


Page 1 of 4  [1] 2 3 4  Next page →

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


csiph-web