Re: [stack] Properties of Concatenative langauges and Forth

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Jan 2, 2009, at 5:50 PM, Christopher Diggins wrote:

>> I think macros and compiling words get a pass.
>
> Forth without compile-time words isn't Turing-complete as far as I can
> tell. I don't think you can just give it a pass. Can you even
> construct a conditional expression in Forth without compile-time
> words?

I was considering Forth's conditional as a functional form with the  
syntax 'IF <expr> THEN <expr> ELSE'. The expressions within the form  
are still completely concatenative. It's true that IF, THEN, and ELSE  
are not functions, but neither are [ and ] which are used for forming  
quotations. Furthermore, 'IF <expr> THEN <expr> ELSE' does indeed  
denote a function. I see no issue with a concatenative language  
offering the functional form of condition.

>> The concatenative requirement is sensibly limited to expressions
>> within the language. In certain cases, it might be required to expand
>> the macros to get the concatenative expression.
>
> Macros sure, but your earlier statement included compile-time words.

Nearly all languages have "compile-time" words, including Cat. Is Cat  
not concatenative because it has 'define'? Of course not, because  
'define' is not part of the expression language. The same goes for  
things in Forth like ':', ';', etc. There may be other examples in  
Forth that break this, but I'm not enough of a Forth programmer to know.

> Joy is a nearly pure example of a special class of programming
> languages. If you remove the side-effects, you are left with a  
> calculus
> of stacks. See my other post about the evaluation of a concatenative
> language, to get a sense of why Joy is special.

That's a pretty big "if". Unfortunately, Joy is not pure enough to  
allow reduction in an arbitrary order in the sense you're describing.  
I agree that your description is correct if side-effects are barred.

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