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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,a498aa1404ef5d87 X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: Why C++ is successful Date: 1998/07/31 Message-ID: <35C20808.18ACCBD2@earthlink.net>#1/1 X-Deja-AN: 376757385 Content-Transfer-Encoding: 7bit References: <35AE4621.2EBC7F6A@eiffel.com> <6p83vj$657$1@news.intellistor.com> <35B79E7D.6068DCDF@eiffel.com> <6pg7fg$qhi$1@news.interlog.com> <901533851.20058.0.nnrp-04.9e980ba3@news.demon.co.uk> <35be2a94.57352308@netnews.msn.com> <6plvgl$eaf$1@news-1.news.gte.net> <35bebe5f.95187031@netnews.msn.com> <6pn9af$hqd$1@uuneo.neosoft.com> <35BF49E8.136D75C2@earthling.net> Content-Type: text/plain; charset=us-ascii Organization: Mandala Fluteworks Mime-Version: 1.0 Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-07-31T00:00:00+00:00 List-Id: Yes, I know what the current Ada spec is on this. I was also informed (forget which book) that routines in library units are not guaranteed to ever clean themselves up (during the life of the program). Annoying. And, yes, I know that those compilers that host themselves on JVM's make use of the embedded garbage collector, but there doesn't seem to be any syntax, and certainly no standard syntax, to control it. At least Java lets you ASK the gc to start. It doesn't have to do it, but you can ask. Basically, I'm very attracted to Ada95. But there are these few little problems: no standard screen controls (need to use some other standard language for that, I guess). No standard gc (yes, I do need to look into descendants of controlled, but the examples that I've seen so far haven't left me feeling optomistic -- basically, if I have a structure with multiple pointers, say a balanced tree with some cursors, there doesn't seem to be any safe way to determine when I can free the node, without a WHOLE LOT of hand waving (sentinals, freeable storage lists, synchronization flags, etc.), so how do I balance the tree? I know in Java that there's a huge amount of *stuff* going on in the background, and it would be v. nice to eliminate this on structures that don't need it. Especially on arrays, etc., of "homogenous type". But I wonder if the gain of eliminating the overhead (and for getting those VERY USEFUL type checks and range types) pays for the cost of user maintained dynamic types. This is the second time I have devoted a month or two to Ada95, because it seems to be SO desireable. Then I hit one of these bottlenecks, estimate the amount of time it will take to implement the feature I'm looking at, and back off again. But if a standard approach were defined, then even if the particular compiler that I was using didn't implement it (i.e., optional annex), at least I would know what syntax my solution should use, so as to be maximally portable. I don't want to build in storage leaks, assuming a garbage collector, when most implementations don't have one. Robert I. Eachus wrote: > > In article <35BF49E8.136D75C2@earthling.net> Charles Hixson writes: > > > But what Ada REALLY needs is a good garbage collection mechanism. And > > saying "Do it by hand" doesn't qualify as good! > > The Ada philosophy is to give the programmer the tools he needs and > to allow him the freedom to create types (classes) that do what is > required for that type. Of course there are also predefined types and > where appropriate there are directions given to the compiler writers > about those types: /* snip */ > do need to put in some storage management code. But with Ada 95, the > most I have ever had to do was about one page of code. (Create a type > descended from Controlled that cleans itself up when no longer visible > by calling Unchecked_Deallocation. These objects are often used for > communication between tasks where a simple protected type won't > do. However, I'd say that 90% of such cases all you have to do is use > Unbounded_Strings.) > > I'll post a very useful example to comp.lang.ada soon. > -- > > Robert I. Eachus > > with Standard_Disclaimer; > use Standard_Disclaimer; > function Message (Text: in Clever_Ideas) return Better_Ideas is...