Re: [stack] Re: the concatenative wikipedia article
Don Groves <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Dec 31, 2008, at 3:25 PM, John Nowak wrote: > > On Dec 31, 2008, at 6:01 PM, Adam wrote: > >> Slava recently created a nice description of Concatenative languages >> in the following four articles > > Thanks, I had hadn't seen that before. > > Slava's description seems decent enough. It is, however, stack- > focused. He says that concatenative languages and stack-based > languages are similar, but then never clarifies the differences and > goes on to conflate the two. I also have some minor niggles (in no > particular order): I haven't worked on this stuff for almost a year now, but when last involved, I was fiddling with the terminology to eliminate the word "stack," which is ingrained in the concatenative culture, but at times not as descriptive as I would like. As these languages mature, their operators become less and less stack-like. I was leaning toward defining a concatenative (if that's the right word) program as "a list of operators applied to a (possibly initially empty) list of operands." This definition seems to me to have two advantages: (1) it allows for non-FIFO shuffle operations like swap, rot, etc..., which are fine for a list but not so for a classically-defined stack; and (2) the order of application is not specified. Not being up on this topic at the moment, the order of application may need to be specified -- [operand] [operators] -- I'm not sure of this. I'd appreciate any comments, as they may save me wasted effort if/when I do return to this eternally intriguing subject (which is why I've returned to it so often already ;-) -- don > 1. There's no reason a concatenative language has to support > recursion. My initial version of 5th did not. > 2. Not all concatenative languages have multiple programmer-accessible > stacks. Forth and Factor do, Joy and Cat do not. > 3. It isn't mentioned that the reduction of a function the > transformation of one function to another. This is the critical thing > I find lacking in FP and FL. > 4. It says composition must be denoted by concatenation. I'd prefer to > say that some sort of concatenation operator is the primary means of > forming programs, be that operator whitespace, a dot, etc. > 5. Quotation works quite differently in Factor and Joy compared to > Cat. In Cat, quotation is an abstraction mechanism (as Chris has > pointed out to me). In Factor and Joy, it is not. It is therefore not > accurate to say a quotation is a sequence of objects. > 6. There's no reason that only one stack be live at any given point. > Joy's persistent stack semantics allow for parallel evaluation. > Ignoring IO, you can reduce programs using rewrite rules applied in > any order and/or simultaneously. > 7. It it said that "literals are pushed onto the stack when > encountered by the evaluator". This implies that '5' is an object, not > a function, which I think is a less useful (and likely inaccurate) > characterization. > > - John > > ------------------------------------ > > Yahoo! Groups Links > > >