From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,62f1e030ed61b97b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-12 10:10:42 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!worldnet.att.net!4.24.21.153!chcgil2-snh1.gtei.net!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: newbie inquiry Date: 12 Jun 2002 12:05:01 -0600 Organization: LJK Software Message-ID: References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1023901534 25352 192.135.80.34 (12 Jun 2002 17:05:34 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Wed, 12 Jun 2002 17:05:34 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:25806 Date: 2002-06-12T12:05:01-06:00 List-Id: In article , "Steven Shaw" writes: > I read somewhere that Ada doesn't have GC. I think I heard that gnat > supports gc. How does this work out for you? Does this mean you have to use > free() when using the standard library? The Ada language definition is susceptible to a garbage-collecting implementation, but typical implementations (including GNAT) do not provide it. The general answer as to "why not?" seems to be that there is not much demand for garbage collection from Ada customers. An earlier (from my observation point on the Internet) pointed to Controlled Types, a more efficient mechanism to perform some (but not all) of the work done by garbage collection. But some situations in Ada are quite different from in other languages. Let us say you are going to call a function What_Size to determine how big you need to allocate a temporary array. In Ada that could be: My_Size := What_Size; declare -- scope of My_Array My_Array : FirnBlatt_Array ( 1 .. My_Size); begin -- scope of My_Array null; -- here we would make use of My_Array end; -- scope of My_Array That is it. When one gets to "end;" the runtime-sized My_Array is gone, with no need to explicitly call a deallocation function. > Would Ada be as good a choice as C for writing an OS? a dbms? Yes, because Ada has the option of automatically providing lots of runtime checks on the sanity of your data. If you think those are slowing your program down, it is possible to suppress some or all of those checks in the final production program, yielding the equivalent of the unchecking C program. But so long as Ada can still find errors in your test runs with those checks, Ada is able to contribute something to your project -- letting you know early on what is wrong with your program rather than simply failing with an illegal memory reference that is difficult to analyze. > The Ada spec is very big. Is it all implemented in gnats? Are there features > in the spec that could/should be avoided? One reason the Ada specification is so big is that is fully specifies the behavior in many areas that might have been omitted in specification of an earlier language. GNAT implements the whole thing. You should avoid any features you don't really need in your program. I have been using Ada for 14 years, and I do not think I have ever used a floating point number. It took a while before I started using the "exit when" feature. For a long time I did not use tasking. That is not because tasking is bad, but because it was not needed for the programs I had to write.