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!tut.cis.ohio-state.edu!bloom-beacon!gatech!hubcap!wtwolfe From: wtwolfe@hubcap.UUCP (Bill Wolfe) Newsgroups: comp.lang.ada Subject: Re: Garbage Collection Message-ID: <3995@hubcap.UUCP> Date: 30 Dec 88 00:46:24 GMT References: <3985@hubcap.UUCP> <692@krafla.rhi.hi.is> Organization: Clemson University, Clemson, SC List-Id: >From article <692@krafla.rhi.hi.is>, by snorri@rhi.hi.is (Snorri Agnarsson): > From article <3985@hubcap.UUCP>, by billwolf@hubcap.clemson.edu (William Thomas Wolfe,2847,): >> When there is great difficulty deciding whether a given object >> exists or not, the maintainer experiences great difficulty >> pinning down the precise state of the program. > > Exactly - and garbage collection is precisely what you need to get rid > of this difficulty. > When you have garbage collection there is no difficulty in determining > whether an object exists or not. It exists if you have some way to > refer to it, otherwise not. So basically you have to sit there and total up the references to every piece of space manually. Sounds like fun. Got an algorithm for doing this in constant time? If not, there is "great difficulty pinning down the precise state of the program". >> DESTROY procedures are easy to write, need only be written once >> per ADT, and can be reused indefinitely. GC costs us the >> computer time required to repeatedly determine which storage >> is in use and which is not, and this cost must be paid repeatedly >> AT RUN TIME. Given that this PERMANENT, RUN_TIME COST can be >> avoided by simply communicating the fact that a particular object >> is no longer needed, GC is a rather costly crutch for lazy programmers. > > The PERMANENT, RUN_TIME COST is very often much worse if you use the > methods Mr. Wolfe dogmatically demands. For example if you have a program > which does calculations with indefinite size integers, then each new integer > value computed is most appropriately stored in a new area in the heap. > If you disallow sharing then each assignment must create a new area. Consider what happens to the storage associated with the old value of the target of the assignment statement. The ASSIGN procedure can reuse it directly rather than deallocating and reallocating it. > Memory management is one of the most difficult things for programmers to > do correctly and efficiently. Garbage collection certainly takes this > burden from the programmer and allows him to think in more abstract terms. Space is an important part of the abstraction. And I challenge the claim that memory management is difficult. One need only deal with a single structural model within the ADT; in the course of writing that ADT's implementation, one will become thoroughly familiar with that structure, and there should be no difficulty deciding when a part of it is no longer needed. > In my opinion reusable software components can not be adequately created > in languages that do not have good automatic memory management. In my opinion, reliance upon garbage collection is the single best way to create an inferior ADT implementation which will be totally rejected by anyone who is programming critical applications. > In this respect Ada is a failure unless garbage collection is required. In this respect garbage collection is a total failure and should NEVER be required. In the interests of seeing to it that portability to the critical-application environment is always possible, GC should be PROHIBITED. > It is regrettable in my opinion that the issue of garbage collection > is so much misunderstood. Particularly by people who have no understanding of the issues applying to proper ADT design. > It is also regrettable that proponents of > the various interesting new programming methodologies do not push > garbage collection as an issue. Functional programming, logic > programming and object oriented programming have only one thing in > common; reliance on garbage collection. None of those methodologies > would have much use in my opinion if it were not for garbage collection. They don't have much use anyway. See David Harland's "Concurrency and Programming Languages". Bill Wolfe wtwolfe@hubcap.clemson.edu