[stack] Re: What does "concatenative" actually mean?

"pml060912" <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
--- In [email protected], William Tanksley <wtanksleyjr@...> wrote:
>
> pml060912 wrote:
> > William Tanksley <wtanksleyjr@> wrote:
> > > Forth -- and any practical language -- has a huge set of basis
> > > functions, and allows you to define your own functions that are used
> > > just like basis functions.
> > No, actually, it has a rather small set of basis functions.
> 
> Probably we have different definitions for the terms "huge" and "basis
> functions".
> 
> I use the term "basis function" in the formal, mathematical sense
> (appropriate for the "functional language" context of the discussion),
> rather than as a synonym for "primitive" or "implemented in machine
> code". In that sense, a "huge" set of basis functions is when a language
> requires far more than the basis functions required in a mathematically
> minimal basis set for that type of language.
> 
> I don't think it's useful to treat "basis functions" as a synonym for
> "primitives".

I wasn't doing so, I was using it as "the set of words (functions) needed to build up the rest". In fact, in a given implementation, there will probably be many of the others implemented as machine code primitives for efficiency reasons, so that set could well be greater. Forth does NOT have or need a huge basis but a rather small one. In the early days that gave a big plus, being able to install Forth easily without the aid of much in the way of software tools for the platform; you only had a little of the awkward work to do before you had a working Forth to help you do the further (application?) work that you were there for in the first place. Eforth in particular only has about 30 words in its basis, and it could probably be cut down further though it wouldn't be worth it. It already implements multiplication through looping and addition (with the expectation that a working system would soon be used to upgrade that and similar inefficient things). I once heard of an implementation called picoforth that I can't track down, that built up stack manipulation words like DROP, DUP and SWAP using temporary/garbage variables and the memory access words @ and !.

All this demonstrates that Forth has a small basis. There is room to argue whether the words used in the text interpreter should also count as part of it, but even there you don't need many. Again, look at eforth for a case in point. P.M.Lawrence.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.