home .. forth .. misc mail list archive ..

Re: Lishp :)


On Apr 19, Christophe Lavarenne wrote:
> >Alan Grimes:
> >I've been studying Lishp theze dayze. It seems that it has much in common with
> >FORTH...
> 
> Lisp and Forth are interactive, as are Logo, Smalltalk, Basic, APL and others.
> Lisp and Forth are extensible, as are Logo, Smalltalk, and very few others.
> Lisp and Forth have not much more in common.

[Note:  I've never used "Lisp" per se - I've dabbled in Scheme though,
and my understanding is that they're fundamentally the same.  Scheme
seems to be experiencing a growth in popularity though, whereas I have
yet to encounter anyone who's done any Lisp programming at all recently.]

The points you make are valid, but I have to disagree with the
conclusion.  I've always seen Scheme and Forth as opposite sides of the
same coin.  One is prefix, one is postfix; one is minimalist in a way
that appeals to hackers and assembly language programmers, the other
minimalist in a way that appeals to mathematicians and AI people.  Both
give you the tools to build whatever tools you might need, though some
would argue that Scheme is a little more generous in return for being
more demanding of the platform.

While implementations of these systems are admitedly worlds apart,
conceptually they have a lot more in common with each other than with
the rest of what's out there, based on my own limited experience.
Certainly I'd find it a lot easier to find similarities between Forth
and Scheme than Forth and Java, which I've seen people try to compare
based on the Java VM and on bytecode...

Incidently, I'm toying with the idea of implementing Scheme on the F21 -
I know that there are scads more academics who'd be interested in
writing code for it like that than in Forth.  And because it's fairly
high-level and list-oriented it'd be a lot easier (in my mind) to run on
a stack machine than C would be.  I'd probably have to make it operate
on dwords (just to satisfy the standard), but it would still be
respectably fast I think...

Just a few other comments on your remarks:

> has a minimalist procedural, postfixed syntax with fixed number of args.

Well, I guess convention is to use a fixed number of args, but there's
no reason it has to be done that way.  You could write an 'add' that
would sum as many stack elements as the top element instructed.

> functionnal result), whereas Forth relies for that on a (weird) distinction
> between "compilation" and "interpretation" semantics.

There is a very wide range of approaches used in various forths, AFAICR.

> Lisp requires an expensive, intensively used, memory garbage collector, and
> uses a single stack with expensive dynamic binding of variables, whereas Forth
> has a minimalist memory static management scheme, with two stacks and a code /

1. GC isn't all that expensive these days (ignore this if you see it as
flamebait.)
2. Dynamic binding isn't the default in Scheme, though I think some
implementations provide a means to achieve it.
3. Forth's memory management scheme is way *too* minimalist for my
tastes (other than for one-off programs), and I think I'm not alone -
hence the ANS ALLOCATE word, and heap-based memory management wordsets that
hook into it.  I expect to see these gain in popularity, though I may be
projecting my own tastes onto the Forth community.