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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!switch.ch!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: in defense of GC (was Re: How come Ada isn't more popular?) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1169531612.200010.153120@38g2000cwa.googlegroups.com> <1mahvxskejxe1$.tx7bjdqyo2oj$.dlg@40tude.net> <2tfy9vgph3.fsf@hod.lan.m-e-leypold.de> <1g7m33bys8v4p.6p9cpsh3k031$.dlg@40tude.net> <14hm72xd3b0bq$.axktv523vay8$.dlg@40tude.net> <4zwt33xm4b.fsf@hod.lan.m-e-leypold.de> <1j7neot6h1udi$.14vp2aos6z9l8.dlg@40tude.net> <1pzx3y7d2pide.y744copm0ejb$.dlg@40tude.net> Date: Sat, 3 Feb 2007 11:00:56 +0100 Message-ID: NNTP-Posting-Date: 03 Feb 2007 11:00:40 CET NNTP-Posting-Host: c3a1f4c6.newsspool1.arcor-online.net X-Trace: DXC=KJdP7XjM7J;D]ncZ]`hZ;1ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9gkKX\j34o\;DNcfSJ;bb[5IRnRBaCdCan5f8D_V26ngci\eB7B@< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8868 Date: 2007-02-03T11:00:40+01:00 List-Id: On Fri, 02 Feb 2007 22:40:51 GMT, Ray Blaak wrote: > "Dmitry A. Kazakov" writes: >> On Fri, 02 Feb 2007 18:15:05 GMT, Ray Blaak wrote: >>> GC does not affect visibility or scoping. >> >> But scoping does affect GC. If scope of each object is known, then there is >> nothing to collect. > > If one is using explicit pointers at all, even within a single scope there is > still manual work to free them, unless you want to force the use of some sort > of smart pointer controlled types (which I find tedious compared to using > native pointers). Why? The language should make no difference between them! BTW, Ada 83 was designed much in this spirit. It had pragma Controlled. > GC alleviates this work even within a single scope. But it is much simpler to hide original object and use controlled pointers as proxies. Again Ada 83 design had that in mind by making access types almost transparent. One should just have made them fully transparent. >> It is the programmer who expresses "in use" in language terms. It could be >> scoped names or a bunch of controlled pointers distributed across the >> program. There must be very strong reasons for choosing the latter. > > I am happy to relax the criteria to be just "practical". With GC, one no > longer needs to have such a strong concern precisely because the consequences > are not dire. Premature or belated finalization can be extremely dire. One of the worst problems I had in C++ was fighting elaboration/finalization order of static library objects. I suppose you propose to express such things using hard references scattered across all objects? BTW, if GC were answer why would anybody require weak references? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de