Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: What is the minimum Word set you could live with to have a (limping) Beginner's ANS Forth Date: Thu, 19 Mar 2015 00:28:09 -0400 Organization: Aioe.org NNTP Server Lines: 125 Message-ID: References: <09b0d52b-de4f-4805-9cc1-fc1cc0499ac3@googlegroups.com> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:37422 On Tue, 17 Mar 2015 19:11:41 -0400, Rod Pemberton wrote: > On Tue, 17 Mar 2015 15:47:17 -0400, JUERGEN 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.