comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Ada 0Y plans for garbage collection?
Date: Tue, 09 Sep 2003 18:30:58 GMT
Date: 2003-09-09T18:30:58+00:00	[thread overview]
Message-ID: <C%o7b.5360$Yt.298@newsread4.news.pas.earthlink.net> (raw)
In-Reply-To: <MPG.19c7f581f148da0798975a@News.CIS.DFN.DE>

Jano wrote:
> 
> I'm very happy using Ada but when one needs to use heap-allocated 
> objects and unchecked deallocation it becomes tiresome rapidly, and that 
> leaving aside memory leaks.
> 
> After some time using Java/.NET or other managed languages this becomes 
> rapidly a great pain if you are in the less real time constrained 
> environments. I was wondering if there are plans to add a standard 
> garbage collection mechanism to the next revision of Ada. Seeing where 
> are going things this seems almost a necessity if Ada has to keep 
> current with times.
> 
> Can someone comment on this? Are there plans to mandate it in 0Y? As a 
> side note, is out there any public implementation of GC for Ada 95?

Ada was designed for mission-critical real-time embedded systems. It is 
the only widely used language designed for real-time embedded systems. 
That's why it has features such as fixed-point types. In other 
languages, such things have to be simulated manually, with the inherent 
increase in errors that entails.

Languages with mandatory GC are generally not used in such systems, and 
are unlikely to be used in such systems in the near future. Therefore, 
the standard will not mandate GC.

The standard could allow GC, so compilers for real-time systems can not 
provide it, but compilers for other systems can. In fact, the standard 
already does allow GC. That you cannot obtain a compiler with GC 
indicates the importance paying customers put on this feature.

For an example of the "Ada way" of addressing memory management, see the 
unbounded, unprotected data-structure components of the PragmAda 
Reusable Components:

http://home.earthlink.net/~jrcarter010/pragmarc.htm

The implementations of these perform manual allocation and deallocation, 
but the client need never concern himself with it. A person, such as 
you, developing systems where memory management is acceptable, can use 
such components and pretend that the language has GC; those developing 
real-time software can avoid such components. If you need to move your 
software to another compiler, you need not limit your compiler selection 
to those that provide GC.

The need for explicit heap allocation is much rarer in Ada than in 
lesser languages. If you are using heap allocation for anything other 
than dynamic data structures, the odds are very good that you can do the 
same thing without heap allocation.

So, if you are a software engineer, memory management is isolated in a 
few well defined places in your software, and the bulk of your 
development effort can ignore memory management issues. If there are 
problems with the memory management, they are easy to find and correct. 
If, on the other hand, you are a coder and sprinkle allocations and 
deallocations throughout your system, then you get what you deserve.

The best thing you could do if you want to demonstrate the importance of 
GC in Ada is to modify GNAT to include GC. If there is really an 
incipient demand for GC, then your version would become widely used, and 
your changes would be incorporated into the mainstream versions of GNAT. 
If not, you would still have a version with GC for your personal efforts.

-- 
Jeff Carter
"Nobody expects the Spanish Inquisition!"
Monty Python's Flying Circus
22




  parent reply	other threads:[~2003-09-09 18:30 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09 13:35 Ada 0Y plans for garbage collection? Jano
2003-09-09 16:24 ` Martin Krischik
2003-09-09 18:30 ` Jeffrey Carter [this message]
2003-09-10  6:55   ` olehjalmar kristensen - Sun Microsystems - Trondheim Norway
2003-09-11 15:09     ` Martin Krischik
2003-09-11 21:21       ` Robert I. Eachus
2003-09-12  8:43         ` Dmitry A. Kazakov
2003-09-12 15:38           ` Martin Krischik
2003-09-15 13:33             ` Dmitry A. Kazakov
2003-09-16 18:04               ` Martin Krischik
2003-09-12 15:49           ` Martin Krischik
2003-09-14 19:26             ` Matthew Heaney
2003-09-14 21:46             ` Berend de Boer
2003-09-14 21:58               ` Ludovic Brenta
2003-09-15  1:43                 ` Robert I. Eachus
2003-09-16 16:48                   ` Jon S. Anthony
2003-09-16 21:45                 ` Berend de Boer
2003-09-17  1:39                   ` Jeffrey Creem
2003-09-17  3:38                     ` Larry Kilgallen
2003-09-17 14:14                     ` Jon S. Anthony
2003-09-17 17:23                     ` Gautier Write-only
2003-09-18  0:39                     ` Berend de Boer
2003-09-18 16:52                     ` chris
2003-09-22 15:51                       ` Robert I. Eachus
2003-09-22 16:29                         ` Warren W. Gay VE3WWG
2003-09-22 16:30                         ` chris
2003-09-23  9:26                         ` Dmitry A. Kazakov
2003-09-24  1:46                           ` Nick Roberts
2003-09-24 14:28                             ` Maxim S. Shatskih
2003-09-24 16:01                               ` Preben Randhol
2003-09-24 16:52                                 ` Stephane Richard
2003-09-24 17:19                                   ` chris
2003-09-25 17:49                                 ` OT " Pascal Obry
2003-09-25 19:30                                   ` Pascal Obry
2003-09-25 20:32                                   ` tmoran
2003-09-26 18:57                                     ` Pascal Obry
2003-09-27  0:40                                       ` Stephane Richard
2003-09-27  8:05                                         ` Preben Randhol
2003-09-27 10:01                                         ` chris
2003-09-24 16:33                               ` Time Taken to Boot Nick Roberts
2003-09-24 20:11                                 ` Mark A. Biggar
2003-09-25 15:14                                   ` Maxim S. Shatskih
2003-09-25 17:29                                     ` Warren W. Gay VE3WWG
2003-09-25 15:00                             ` Ada 0Y plans for garbage collection? Robert C. Leif
2003-09-12 17:20           ` Robert I. Eachus
2003-09-13  9:54             ` Martin Krischik
2003-09-13 20:37               ` Robert I. Eachus
2003-09-15 13:33             ` Dmitry A. Kazakov
2003-09-15 21:17               ` Alexander Kopilovitch
2003-09-14 19:10     ` Matthew Heaney
2003-09-15  6:48       ` Martin Krischik
2003-09-14 13:19 ` Matthew Heaney
replies disabled

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