comp.lang.ada
 help / color / mirror / Atom feed
* Garbage collector on Ada?
@ 2002-06-21 10:41 Pedro Menendez
  2002-06-21 12:07 ` Jacob Sparre Andersen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Pedro Menendez @ 2002-06-21 10:41 UTC (permalink / raw)


Hi all,

Is there any Ada implementation that uses a garbage collector?

I thought so, but someone told me that it would be quite impossible considering 
Ada is a real-time language, but in case there were some garbage collector he 
said that it wouldn't be a standard implementation

what do you think about?

Thanx a lot



Pedro Menendez

Oviedo (Asturias) - Spain

http://petra.euitio.uniovi.es/~i1641014



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 10:41 Garbage collector on Ada? Pedro Menendez
@ 2002-06-21 12:07 ` Jacob Sparre Andersen
  2002-06-21 13:43   ` Dr. Michael Paus
  2002-06-21 14:35 ` Wes Groleau
  2002-06-21 15:32 ` Darren New
  2 siblings, 1 reply; 12+ messages in thread
From: Jacob Sparre Andersen @ 2002-06-21 12:07 UTC (permalink / raw)


Pedro Menendez wrote:

> Is there any Ada implementation that uses a garbage collector?

Yes. JGNAT (and maybe also others).

> I thought so, but someone told me that it would be quite impossible considering
> Ada is a real-time language, but in case there were some garbage collector he
> said that it wouldn't be a standard implementation

Since the standard specifically allows garbage collectors,
it would be very strange if it was impossible to implement.
But it definitely appears to be atypical.

Jacob
-- 
Henriks signatur er p� sommerferie her.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 12:07 ` Jacob Sparre Andersen
@ 2002-06-21 13:43   ` Dr. Michael Paus
  2002-06-21 21:32     ` Robert I. Eachus
  2002-06-22 10:37     ` Pedro Menendez
  0 siblings, 2 replies; 12+ messages in thread
From: Dr. Michael Paus @ 2002-06-21 13:43 UTC (permalink / raw)


Jacob Sparre Andersen wrote:
> Pedro Menendez wrote:
> 
> 
>>Is there any Ada implementation that uses a garbage collector?
> 
> 
> Yes. JGNAT (and maybe also others).
> 
> 
>>I thought so, but someone told me that it would be quite impossible considering
>>Ada is a real-time language, but in case there were some garbage collector he
>>said that it wouldn't be a standard implementation
> 
> 
> Since the standard specifically allows garbage collectors,
> it would be very strange if it was impossible to implement.
> But it definitely appears to be atypical.

Just for curiosity. Has there ever been an Ada implementation besides JGNAT which
uses a garbage collector?

Michael




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 10:41 Garbage collector on Ada? Pedro Menendez
  2002-06-21 12:07 ` Jacob Sparre Andersen
@ 2002-06-21 14:35 ` Wes Groleau
  2002-06-21 15:05   ` tgingold
  2002-06-21 15:32 ` Darren New
  2 siblings, 1 reply; 12+ messages in thread
From: Wes Groleau @ 2002-06-21 14:35 UTC (permalink / raw)


Does the gcc Java compiler do garbage collection?

Or is that assumed to be a JVM thing, omitted for
a native compiler?

If it does garbage collection, is that in the back end?

And if it's in the back end, how hard would it be
to tweak it so that it provides GC for other languages?

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 14:35 ` Wes Groleau
@ 2002-06-21 15:05   ` tgingold
  2002-06-21 15:29     ` Wes Groleau
  0 siblings, 1 reply; 12+ messages in thread
From: tgingold @ 2002-06-21 15:05 UTC (permalink / raw)


In article <3D1339BF.A2EB67B5@despammed.com>, Wes Groleau wrote:
> Does the gcc Java compiler do garbage collection?
Yes, of course.

> Or is that assumed to be a JVM thing, omitted for
> a native compiler?
It is part of the JVM environment.

> If it does garbage collection, is that in the back end?
No, it is a library.

> And if it's in the back end, how hard would it be
> to tweak it so that it provides GC for other languages?
It is the Bohm's conservative GC.
You *should* be able to use it with GNAT, but there is more work to do 
(things such as finalization).

Tristan.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 15:05   ` tgingold
@ 2002-06-21 15:29     ` Wes Groleau
  0 siblings, 0 replies; 12+ messages in thread
From: Wes Groleau @ 2002-06-21 15:29 UTC (permalink / raw)



> > Does the gcc Java compiler do garbage collection?
> Yes, of course.
> 
> > Or is that assumed to be a JVM thing, omitted for
> > a native compiler?
> It is part of the JVM environment.

I was talking about the gjj (or whatever the name is)
that goes from Java to native code.  So the above two
answers seem contradictory.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 10:41 Garbage collector on Ada? Pedro Menendez
  2002-06-21 12:07 ` Jacob Sparre Andersen
  2002-06-21 14:35 ` Wes Groleau
@ 2002-06-21 15:32 ` Darren New
  2002-06-21 15:46   ` Ole-Hjalmar Kristensen
  2 siblings, 1 reply; 12+ messages in thread
From: Darren New @ 2002-06-21 15:32 UTC (permalink / raw)


Pedro Menendez wrote:
> someone told me that it would be quite impossible considering 
> Ada is a real-time language,

Well, unless you used a real-time garbage collector. It sounds like 
"someone" isn't up on this decade's technology.

Hmmm... Looks like "someone" isn't even up on how Google works.

http://lieber.www.media.mit.edu/people/lieber/Lieberary/GC/Realtime/Realtime.html







^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 15:32 ` Darren New
@ 2002-06-21 15:46   ` Ole-Hjalmar Kristensen
  0 siblings, 0 replies; 12+ messages in thread
From: Ole-Hjalmar Kristensen @ 2002-06-21 15:46 UTC (permalink / raw)


Darren New <dnew@san.rr.com> writes:

> Pedro Menendez wrote:
> > someone told me that it would be quite impossible considering Ada is
> > a real-time language,
> 
> Well, unless you used a real-time garbage collector. It sounds like
> "someone" isn't up on this decade's technology.
> 
> Hmmm... Looks like "someone" isn't even up on how Google works.
> 
> http://lieber.www.media.mit.edu/people/lieber/Lieberary/GC/Realtime/Realtime.html

Baker's algorithm is old and well known and pretty good. But the
problem with any copying garbage collector, including this new one, is
that if you copy large objects, that *may* be enough to disturb your
timing, unless you run the garbage collector in a separate thread, and
thus allows the copying to be interrupted. Baker's original paper
mentions this, and also explains why running the garbage collector in
a separate thread is difficult.

But I agree, GC is good for may applications, and with some care, can
be used even for RT applications.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 13:43   ` Dr. Michael Paus
@ 2002-06-21 21:32     ` Robert I. Eachus
  2002-06-24  9:36       ` Ole-Hjalmar Kristensen
  2002-06-22 10:37     ` Pedro Menendez
  1 sibling, 1 reply; 12+ messages in thread
From: Robert I. Eachus @ 2002-06-21 21:32 UTC (permalink / raw)



Dr. Michael Paus wrote:

> Just for curiosity. Has there ever been an Ada implementation besides 
> JGNAT which uses a garbage collector?
 

Yes, Symbolics had an Ada 83 compiler with garbage collection.


Pedro Menendez wrote:

 
> Since the standard specifically allows garbage collectors,
> it would be very strange if it was impossible to implement.
> But it definitely appears to be atypical.


Actually, the reason that most Ada compilers don't have general garbage 
collectors is that most of Ada is designed to avoid distributed costs. 
For example, if you use Ada.Strings.Unbounded, the standard requires 
that the type not leave uncollected garbage. The typical implementation 
is to use a protocol that either explicitly does reference counting or 
does copying on assignment.  That way you only pay a small, fixed cost 
if and when you use Ada.Strings.Unbounded.

Similarly most packages that create either many objects on the heap or 
large objects on the heap tend to take out their own garbage.  It would 
be nice to have a general purpose garbage collector available as a 
storage pool, such that any objects in the pool would be subject to 
garbage collection.  But I don't know of such an implementation.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 13:43   ` Dr. Michael Paus
  2002-06-21 21:32     ` Robert I. Eachus
@ 2002-06-22 10:37     ` Pedro Menendez
  2002-06-22 11:29       ` Jacob Sparre Andersen
  1 sibling, 1 reply; 12+ messages in thread
From: Pedro Menendez @ 2002-06-22 10:37 UTC (permalink / raw)


Thanx a lot for your answers. I found them very useful

In article <3D132D6C.5050908@ib-paus.com>, "Dr. Michael Paus" <paus@ib-paus.com> 
wrote:
>Jacob Sparre Andersen wrote:
>> Pedro Menendez wrote:
>> 
>> 
>>>Is there any Ada implementation that uses a garbage collector?
>> 
>> 
>> Yes. JGNAT (and maybe also others).
>> 
>> 
>>>I thought so, but someone told me that it would be quite impossible
> considering
>>>Ada is a real-time language, but in case there were some garbage collector he
>>>said that it wouldn't be a standard implementation
>> 
>> 
>> Since the standard specifically allows garbage collectors,
>> it would be very strange if it was impossible to implement.
>> But it definitely appears to be atypical.

what I mean is there any authoritative source that states this?
the RM or MIL/STD ??? , for instance?

is there any validated compiler with GC?

>Just for curiosity. Has there ever been an Ada implementation besides JGNAT
> which
>uses a garbage collector?
>
>Michael

regards



Pedro Menendez

Oviedo (Asturias) - Spain

http://petra.euitio.uniovi.es/~i1641014



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-22 10:37     ` Pedro Menendez
@ 2002-06-22 11:29       ` Jacob Sparre Andersen
  0 siblings, 0 replies; 12+ messages in thread
From: Jacob Sparre Andersen @ 2002-06-22 11:29 UTC (permalink / raw)


Pedro Menendez wrote:

> In article <3D132D6C.5050908@ib-paus.com>, "Dr. Michael Paus" <paus@ib-paus.com>
> wrote:
> >Jacob Sparre Andersen wrote:
> >> Pedro Menendez wrote:

> >> Since the standard specifically allows garbage collectors,
> >> it would be very strange if it was impossible to implement.
> >> But it definitely appears to be atypical.
> 
> what I mean is there any authoritative source that states this?
> the RM or MIL/STD ??? , for instance?

It is likely to be in chapter 13 in the LRM. Looking up
"garbage collection" in the index gives a reference to
13.11.3(6) in the 1995 edition of the LRM.

> is there any validated compiler with GC?

Don't know.

Jacob
-- 
"The point is that I am now a perfectly safe penguin!"



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Garbage collector on Ada?
  2002-06-21 21:32     ` Robert I. Eachus
@ 2002-06-24  9:36       ` Ole-Hjalmar Kristensen
  0 siblings, 0 replies; 12+ messages in thread
From: Ole-Hjalmar Kristensen @ 2002-06-24  9:36 UTC (permalink / raw)


"Robert I. Eachus" <rieachus@attbi.com> writes:

> Dr. Michael Paus wrote:
> 
> > Just for curiosity. Has there ever been an Ada implementation
> > besides JGNAT which uses a garbage collector?
>  Yes, Symbolics had an Ada 83 compiler with garbage collection.
> 
> 
> Pedro Menendez wrote:
> 
>  
> > Since the standard specifically allows garbage collectors,
> > it would be very strange if it was impossible to implement.
> > But it definitely appears to be atypical.
> 
> 
> Actually, the reason that most Ada compilers don't have general
> garbage collectors is that most of Ada is designed to avoid
> distributed costs. For example, if you use Ada.Strings.Unbounded, the
> standard requires that the type not leave uncollected garbage. The
> typical implementation is to use a protocol that either explicitly
> does reference counting or does copying on assignment.  That way you
> only pay a small, fixed cost if and when you use Ada.Strings.Unbounded.
> 
> Similarly most packages that create either many objects on the heap or
> large objects on the heap tend to take out their own garbage.  It
> would be nice to have a general purpose garbage collector available as
> a storage pool, such that any objects in the pool would be subject to
> garbage collection.  But I don't know of such an implementation.

Neither do I for Ada compilers. But Modula-3 has (had?) exactly that,
you can choose garbage collection or not, depending on the pool.





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-06-24  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-21 10:41 Garbage collector on Ada? Pedro Menendez
2002-06-21 12:07 ` Jacob Sparre Andersen
2002-06-21 13:43   ` Dr. Michael Paus
2002-06-21 21:32     ` Robert I. Eachus
2002-06-24  9:36       ` Ole-Hjalmar Kristensen
2002-06-22 10:37     ` Pedro Menendez
2002-06-22 11:29       ` Jacob Sparre Andersen
2002-06-21 14:35 ` Wes Groleau
2002-06-21 15:05   ` tgingold
2002-06-21 15:29     ` Wes Groleau
2002-06-21 15:32 ` Darren New
2002-06-21 15:46   ` Ole-Hjalmar Kristensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox