Type-checking, GC, Forth, rewriting.. (was: garbage collected forths)

Hendrik Boom hendrik at pooq.com
Fri Apr 29 08:08:16 PDT 2005


On Fri, Apr 29, 2005 at 07:13:39AM +0200, Massimo Dentico wrote:
> Hendrik Boom wrote:
> 
> >[..]
> >> - Joy, http://cliki.tunes.org/Joy
> >>    somewhat the "pure" concatenative language, much more
> >>    experimental. GCed.
> >
> >Ugh Rewriting is slow.
> 
> Well, I'm not familiar with its implementation (an interpreter
> written in C) but consider that:
> 
> a) Joy semantics is about pure functions from stack to stack;
>   rewriting rules are used only to clarify this semantics
>   and to reason about programs; there is nothing in the
>   language which prevent use of Forth-like implementation
>   techniques, both for interpretation - with various
>   threaded code techniques - that for compilation.

The description I saw suggested that it was actually interpreted
using a rewriting tool.  This would be slow.  If it was just a
formal description, but execution was by other means, that would
be different, of course.

My aversion to rewriting is not absolute.  One of my most-used
tools here is a rewriting engine that compiles its rewriting
rules directly into C code.  But it imposes a lot of structure
in the rewriting system, a lot of context (symbol tables and
the like), and a backtracking mechanism for when things fail.
My experience is that when the real point of your application
is the rewriting of trees, then a rewriting system is fine.
But when it is something else that has been encoded as a
rewriting system (rewriting is a universal computational
formalism, after all),  you lose big.

---

I just saw how long this letter I'm answering is, and
I appreciate it -- it's so rare to get an extensive,
well-thought-out answer on a mailing list, and you
deserve the same.  But I'm running out of time today --
-- I still have tax forms to file.  A proper reply
would probably take an entire essay, which I intend to get
around to soon.


Thanks again

-- hendrik



More information about the TUNES-LLL mailing list