From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public From: nmm1@cus.cam.ac.uk (Nick Maclaren) Subject: Re: WAS Re: Final kick at the "Merced Guessing Game" Date: 1997/10/18 Message-ID: <62a0f5$9p8$1@lyra.csx.cam.ac.uk>#1/1 X-Deja-AN: 281459736 References: <61cqkc$9r@news-rocq.inria.fr> <3444288C.7F4E@world.std.com> <34462D38.167E@lanl.gov> <3447D55B.1CDE@world.std.com> Organization: University of Cambridge, England Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec In article <3447D55B.1CDE@world.std.com>, David Chase wrote: >William Clodius wrote: > >> A minor point, but one aspect in which conventional languages are >> starting to resemble functional languages is in the presence of garbage >> collectors. While I don't know of any C or C++ implementations that >> provide it, the availabiltiy of the Boehm collector and the commercial >> add ons is starting to impact the C/C++ community. ... > >There's some problems here, at least with respect to C. Fortran 90 >is somewhat saner with its pointers than is C, at least in its >specification. Working only within the C specification, it is >possible for the programmer to create pointers anywhere within the >interior of a structure or an array, or to the first address after >such an object. In practice, C programmers commit vastly more >disgusting sins (my favorite -- out-of-bounds pointer arithmetic >from a freed pointer. ... Yes, and I regard this whole mess as a tragedy of the first water. The point is that there are TWO aspects here: 1) Are ALL pointer operations checked? 2) Is there a semi-automatic way of recovering dead space? The confusion that caused the Maclaren-O'Keefe explosion was due to a misunderstanding over this. I was stating that I did not like the second and had never seen a good one - but I was NOT stating that I did not want the first! What I actually want is a language where all pointer uses are checked, and I get an error when I get it wrong, but where the system does not do unspeakable things to my data storage behind my back. I have a fair amount of experience in attempting to debug problems in large programs (not mine) with unchecked pointers AND garbage collection, and it has almost always been a complete disaster. The effect of an error is that it is rarely detected near where it occurs, and the garbage collector has destroyed all the evidence by the time the program falls over. I have several times had to resolve this problem in cases where the authors of the code admitted defeat, and it took AGES. Hence my position. If don't really WANT garbage collection, but I will put up with it (for most programs) ONLY if all pointer operations are checked. If that is not so, I don't want to know. Nick Maclaren, University of Cambridge Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB2 3QG, England. Email: nmm1@cam.ac.uk Tel.: +44 1223 334761 Fax: +44 1223 334679