Re: [stack] sweetening concatenative syntax

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Mar 7, 2008, at 5:15 PM, William Tanksley, Jr wrote:

> John Nowak <[email protected]> wrote:
>
>> William Tanksley, Jr wrote:
>>
>>> 'f' is referred to twice; that's nonlinear.
>>
>> Keep in mind that the pointful version gets translated to pointfree
>> code. It's just syntactic sugar.
>
> We're comparing lambda notation to pure concatenative notation. Your
> claim is that lambda notation is "objectively" superior.

My claim was that it was superior for a particular case, to be clear.  
I certainly don't believe this is true in the general case.

> You can't have it both ways, using lambda notation to make something
> look good (subjectively) and then converting it to a concatenative
> notation to make it meet some objectively measurable property.

I don't understand. It seems I can indeed have it both ways. Isn't  
converting a language to a simpler language what compilers do all the  
time? Maybe I'm misunderstanding.

> It's objectively true that lambda notation freely allows nonlinear
> references.

This is incorrect. "Linear" means that *values* have at most one  
reference to them. It has nothing to do really with how often a given  
variable shows up the source code. Take a look at Henry Baker's Linear  
Lisp. It certainly has lambdas, but it is also certainly linear. There  
are also languages like Clean that enforce linearity through the type  
system. Likewise, you can have non-linear languages that do not have  
variables. Look at Joy for example.

> It's also true that this can be optimized away, but it's
> NOT clear how expensive that will be (the expense is always up-front
> with a concatenative notation, which is sometimes uncomfortable but
> always clear).

There actually are clear rules for determining how many times copying  
will be necessary when using lambda expressions. The rule is that a  
variable will be copied N-1 times where N is the number of times it is  
used. There is only one exception to this rule: Uses in separate  
functions "directly applied" to a sum deconstructor (unlist, if, etc)  
do not require copying. The implementation may choose to eliminate  
additional copies if possible as well, just as it may do when you  
write code in a purely pointfree form, but that's besides the point.  
One of my requirements for introducing lambdas is that there be very  
clear rules for when copying will occur, so you can be sure this will  
be formally specified, simple, and not implementation-dependent.

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