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 4:24 PM, John Nowak wrote:

> On Dec 31, 2008, at 6:54 PM, Don Groves wrote:
>
>> 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."
>
> I don't think this is a satisfactory definition for a few reason:
>
> 1. What exactly is a "list of operators"? Do you mean a sequence of
> functions reified as a list of objects? I don't think that's  
> necessary.

As I now belatedly recall, no doubt prompted by your words, I was
using "sequence of operators" and "sequence of operands" rather
than lists.


> 2. For me, the main advantage of a concatenative language is that you
> get rid of application. Manfred von Thun pointed this out in his "Joy
> compared with other functional languages" paper and I think it is
> critical to the definition of concatenative languages.

I'll review that paper. Perhaps my use of of the word "application" to
indicate the catenation of two sequences, e.g., [a b] [+] is confusing.


> 3. There's no reason that the data structure the functions operate on
> be a list or a stack. I recently proposed a language using vectors in
> the style of More's array theory. Earlier today, Chris proposed a
> language based on a deque. I believe XY works on a stack/queue tuple.
> Other possibilities are easy to dream up.

The reason I picked "sequence" is that it seems to be the most basic
ordered structure.


>> the order of application is not specified.
>
> This would depend on the language in question. Various evaluation
> strategies can be employed. In a language with side effects, the order
> of reduction is going to be important. One could even imagine a
> language with a term rewriting semantics that allows definitions of
> the form 'dup drop  -> id'. If your rewrite rules aren't confluent,
> the way in which you reduce will matter.

Many thanks for taking the time to comment, John. I'll tuck this away
with my notes for when the urge strikes again...
--
don

> - John
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.