Re: [stack] language hierarchy

"William Tanksley, Jr" <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
John Nowak <[email protected]> wrote:
> William Tanksley, Jr wrote:

> > Hmm. Okay, I think I get it. Review: composable means that function
> > composition is available and capable of forming interesting programs.
> > Concatenative means that function composition is the default operation
> > (performed by merely concatenating functions).

> No, not quite. Composable means composing functions is the only way to
> write programs.

Okay, sorry. You might want to choose a different word form then...
the suffix "-able" means that the action is possible, not that it's
mandatory. Perhaps "compository" or "compositional"?
http://plato.stanford.edu/entries/compositionality/ (already taken,
but not in programming).

> Joy works this way. Concatenative languages are
> composable languages with Joy-style syntax. I do not know of any
> language that is composable and not also concatenative; It's the
> obvious syntax to use. However, you can imagine such languages fairly
> easily.

So "concatenative" in your definition refers ONLY to the syntax of a
composable language! Interesting. Perhaps Chris is right, and your
definition of "concatenative" could apply to non-composable languages
as well.

> >> I don't think there's anything composable about Haskell, strictly
> >> speaking. The compose operator in Haskell is really just a function
> >> with infix syntax that operates on functions /as values/ via function
> >> application.

> > Perhaps, but the language supports that composition on such a
> > fundamental level that it's hard to identify it as NOT part of its
> > syntax.

> It isn't any more part of the syntax than 'apply' is part of Cat's
> syntax.

Apply doesn't have special syntax support in Cat. The composition
operator has special syntax support in Haskell.

> > A number of different subsets of Haskell can be constructed
> > that form a composable language -- for example, consider a stack
> > monad. At least if I'm reading your definition of 'composable'
> > correctly.

> No, I don't think you are. The compose function in haskell operates on
> values via application, not on functions directly as it does in Joy.
> Haskell is a functional language, not a function-level language like FL.

When you're looking at a Haskell program which uses composition
exclusively, can you tell it's not actually "composable"? I would say
that there are subsets of Haskell which are composable, just as there
are subsets of Joy which are not (for example, function definition).

> >> This is something you can add to most any vaguely
> >> functional language:
> >>        (define (compose f g) (lambda args (f (apply g args))))

> > Sure; and if you can define that as infix, your language has
> > superficial support for composability.

> Neither infixness, nor any other syntax-related feature, has anything
> to do with my definition of 'composable'.

All features of a language are syntax-related.

> - John

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