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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!watmath!clyde!att!osu-cis!killer!ames!xanth!nic.MR.NET!csd4.milw.wisc.edu!leah!itsgw!steinmetz!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.ada Subject: Re: Garbage Collection Message-ID: <4232@enea.se> Date: 10 Jan 89 19:16:00 GMT Organization: ENEA DATA AB, Sweden List-Id: This is where this discussion ends for my part. It has been going on far too long. It seems quite obvious that no one here, at least not me, will succeed in converting Bill Wolfe to believe that garbage collection is good. And it does not seem like he will convert anyone either. I'm glad to hear that Reference.all will survive the block exit. I am still a little puzzled, though. Assume that instead of a "simple pointer" we actually have a linked list, declared as (limited) private in some package. Then, it's Destroy routine will be called at block exit. Now, I don't know how you folks write your Assign procedures for linked lists, but I do simple pointer copying. (And I assume that Bill Wolfe does the same, since he is so keen on that his ADTs will be useful in a real-time environment. Copying value and allocating memory for the new lists would be as harmful as garbage collection, if not worse.) This means of course that my implicit Destroy procedure must be just NULL(*). Then I have an another for the user to call when is tired of his list. Excuse me, but is call-destroy-on-block-exit really a useful device? Seems like adding something to the langauge which you almost should never use. And same goes for the user to supply a Destroy procedure to the generic package. Since its body often will be NULL, its appearance in the instantiating package is just white noise. (*) This isn't really true. If the reference assignment also includes updating of reference counters, we can check them in the Destroy procedure. We have now drifted in to the land of poor man's garbage collection, where to have to very careful everytime so we are not doing something stupid. Finally, Bill Wolfe has claimed that not having garbage collection helps the programmer to understands all aspects of his code, both time and space. Eh, there are some more aspects on the code than so. For example, that it really does what it supposed to. It may very elegantly sweep away all used memory and that, but tell us that 2 + 2 = 5. No good program. Fact is, in many applications, space is seldom an important problem, if at all. All you want to be sure of is that you really got rid all of you allocated, so that your interactive user donesn't get a dump after five hours work. And, oh, the world is not divided into ADT implementors and application programmers. It just doesn't look that way. -- Erland Sommarskog ENEA Data, Stockholm This signature is not to be quoted. sommar@enea.se