Re: [stack] Barebone implementation of concatenative language in c or c++

John Cowan <[email protected]> Tue, 18 May 2010 14:42:16 -0400
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
[email protected] scripsit:

> This view breaks down once your functions have side effects (which is the
> case in Joy). Because if this, the arbitrary order reduction you're talking
> about needs to be subject to side constraints regarding purity.

Quite so.  Joy, like ML or Pure, is an eager impure functional programming
language.  Consequently, arbitrary reordering is not permitted.

> The utility of arbitrary order rewriting in Joy is also severely limited
> by the fact that quotations are not opaque. For example, it is not valid to
> rewrite [1 2 +] to [3] because the quotation may be treated as a list later
> on. It is for this reason that I consider Joy's approach to quotations to
> be broken; a separation of quotations from lists would solve the problem.

If you consider it a problem.  I consider it one of Joy's special beauties:
the abstraction for a sequence of datums is the same as the abstraction for
a non-primitive function, which is just a sequence of functions.

> Finally, applicative languages arguably have an advantage over Joy in
> terms of arbitrary order reduction. For example, take this Haskell
> function:

I don't think your example has anything to do with applicativeness, but
with purity and laziness.  A pure lazy concatenative language would have
the same strengths (and weaknesses) as Haskell.

-- 
Kill Gorgun!  Kill orc-folk!            John Cowan
No other words please Wild Men.         [email protected]
Drive away bad air and darkness         http://www.ccil.org/~cowan
with bright iron!   --Ghan-buri-Ghan    http://www.ccil.org/~cowan