From: Cyber Surfer
Subject: Re: GCs (was: Why Isn't Lisp a Mainstream Language?)
Date: 
Message-ID: <memo.941098@cix.compulink.co.uk>
·······@ehsn11.cen.uiuc.edu (Joshua M Yelon) was saying:

> linkedlistint append(sublist1, sublist2)
>     linkedlistint sublist1;
>     linkedlistint sublist2;
>     { ...

Why should this run any differently in C than in Lisp? Just
use a GC that works in C. I do this in my own Lisp, and Dave
Betz does it in XLISP. I've even done it in C++, where it's
easier to use. 

> There is no solution to this problem in C.  There is simply no
> fast, elegant append subroutine with correct 'dispose' behavior.

If this is all you like about Lisp, you may as well use Oberon
or Modula-3, as they both have a GC.

If you still have doubts, then try Knuth's Fundamental Algorithms
for a simple mark/sweep collector that can work in C. My GC uses
the compactor from Fundamentals of Data Structures, by E Horowitz
and S Sahni. It worked first time, despite being heavily modified
to cope with various Lisp data types. Recommended.

Most of your other points can be dismissed by using small runtime
subroutines for filling an activation record with NILs, or tagging
and untagging pointers. On a modern RISC, this should be as fast
as using a dedicated hardware instruction.

> you must never borrow a bit from a pointer.  Lots of tree and

Just make the pointer a compact object. This solution is very
simple when you think about it positively. It *can* be done.

I often find that problems in a language are really just the
particiular implementation and its limits, like a C compiler
forced to run in too little memory. If that compiler is designed
with those limits in mind, it's no suprise to find that the more
memory hungry optimisations are left out.

It strikes me that most CL implementations are designed with
the limits of a particular Unix in mind. There is no support
for shared libraries because not every platform supports that
feature. My suggestion is make sure that the platform you use
supports the software you use, and that means the language also.

-- Cyber Surfing on CIX --