[gclist] Language behaviour wrt GC (Was: Name that hypothesis)

Geert Bosch geert@sun3.iaf.nl
Thu, 05 Dec 96 02:39:08 +0100

On Wed, 4 Dec 1996 10:46:25 -0800, Hans Boehm wrote:
>Given an exclusive choice, I greatly prefer option (b).  This does introduce
>some biases.  But it's not clear to me why it should bias pointer direction
>measurements, except in comparison to language implementations that make it
>hard or impossible to introduce forward pointers.

This discussion makes me wonder again how much languages determine
programming style and allocation behavior. One of the reasons I'm
very interested in this is the following.

The programming language Ada-95 has these properties:
   -- The stack is used in a very flexible way:
         + local objects of subprograms can have size determined by 
           an initialization expression possibly based on parameters
         + functions can have such objects as return values
   -- Pointers to static data are (statically) checked as follows:
         + The accessibility level of pointers to aliased stack-allocated
           objects must be deeper than that of the object it references.

The effect of these properties is that in most situations where C uses
dynamic memory allocations it is not needed in Ada. When using pointers
to stack-allocated data it is not possible to create dangling references.
All pointers in the stack pointing to the stack are backward pointers.

So the only reason to use dynamic memory allocation is in cases where 
having backward pointers is not enough. I'm very curious what the effects
of this would be for the garbage hypotheses posted lately.

It's a little bit sad that a modern language that actually *needs* a
garbage collector if you don't want to use Unchecked_Deallocation, has 
no good implementations that have one. As a small survey has indicated
the main property of such a collector would be safety, which is why not m
any people are interested in a conservative collector. 

There is a lot of interest in a precise (preferably compacting) 
garbage collector on the other hand. What I'm interested in is what
GC techniques would be efficient in this particular case. Also note
that Ada is a tasking language. Most literature on GC seems to deal
with C at one side or very "artificial" languages at the other side.

I have not found very much information or statistics on strongly typed,
statically checked tasking languages like Ada and Modula-3.

-- e-mail: geert@sun3.iaf.nl