Joy, Lambdas, Combinators, Procedures
Thu, 27 Jan 2000 12:59:02 -0800

> From: []

> > One thing about Joy which bothers me is that it gives no way
> > > to formally express, for example, the number "2". Although it
> > > is possible to express the _program_ that "pushes the number 2
> > > onto the stack" (such a program is expressed simply as "2"), the
> > > number 2 itself cannot be represented. 

> > Okay, I admit it -- I'm completely and utterly lost.  What 
> > are you talking about?  The symbol 2 represents the number 2.

> Here's an excerpt from the Joy synopsis (under the section
> "Joy compared with other functional languages):

>    The program

>       3  +

>    denotes the composition of two functions from stacks to stacks. The
>    first pushes the number 3, the second adds two number on top of the
>    stack. The entire program denotes a function which adds 3 
>    to the top
>    number of the stack. The space between the 3 and the + is not
>    application written in reverse but composition.

> The authors of Joy want to interpret the symbol "3" as the 
> program that
> pushes the number three onto the stack; they do not interpret it
> as the number three itself. Hopefully that clears things up.

It certainly makes the distinction clear.  Thanks.

I'm unclear on the concept of "the number itself."  Are you implying that
each number has some kind of platonic existance?  What would happen if a
language decided to represent a number?

> Anyway, Joy is only intended to be a "programming language", so
> I suppose it is intentional that programs are the only things
> that can be expressed in it.

Yes.  '3' is a function which takes as input a stack and produces a stack
which is one deeper (and whose top element happens to be a representation of
the number 3).

> > > [building "chaining" into procedures]
> > > Anyhow, this is probably not
> > > really a new idea.

> > What is different about it?  It seems the same as all the 
> > other functional
> > languages.

> Hmm... Well, Haskell for example doesn't seem to use this technique.
> In Haskell, a procedure "putChar 'b'" is considered atomic
> (rather than a function that takes the thing to do next); the
> binary operator ">>" (hidden by syntax sugar often) is used
> to chain procedures together. If there is a result, ">>>" is used,
> I believe.

I guess I'm more confused by what use this all is.  It seems as useful as
any other system, but no more.

> > > Anyway, enough rambling... As usual there is my recently updated
> > > site on TUNES at
> > >
> > > which I humbly proclaim as the Best source of introductory
> > > information on combinators (that I know of).

> I was not really being serious. 
> I'd like to have your input on it though...

I'll go over it after work today.

> It is surely filled with typos and numerous other errors.

Many hands make light work.

> Anyway, Forth is beginning to sound interesting...
> What is your favorite Forth system?

I use Pygmy Forth, gForth, and Quartus.  gforth is a 32-bit portable ANSI
standard system written in C which I use when convenient; I have no real
love for it (aside from its easy availability).  Quartus is an
elegantly-built 16-bit ANSI Forth for Palm Pilots.  Pygmy is a 16-bit
nonstandard Forth which is elegantly designed and easy to work with; it
includes an editor and metacompiler so I can modify it.

Pygmy's design is an imitation of cmForth, one of Chuck Moore's 10-year-old
efforts.  Chuck has since made some advances in his Forth experimentation; I
find Machine Forth very interesting, although I don't have an
implementation.  Color Forth is his latest publicly known work, but I
haven't really dug into it.  Its theory has some vague resemblance to Joy in
some ways.

> > > - "iepos" (Brent Kerby)

> > -Billy