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.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news4.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!irazu.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: How come Ada isn't more popular? Date: Fri, 09 Feb 2007 09:17:47 +0100 Organization: CERN News Message-ID: References: <1169636785.504223.139630@j27g2000cwj.googlegroups.com> <45b8361a_5@news.bluewin.ch> <3pejpgfbki.fsf@hod.lan.m-e-leypold.de> <1ic9j6bmbl0ik.gvgqhl1ixvxk$.dlg@40tude.net> <1v9qweobb6xei.z5hdupxed63u.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1171009067 21011 137.138.37.241 (9 Feb 2007 08:17:47 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Fri, 9 Feb 2007 08:17:47 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: <1v9qweobb6xei.z5hdupxed63u.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:9171 Date: 2007-02-09T09:17:47+01:00 List-Id: Dmitry A. Kazakov wrote: >>> For handling cycles there are weak pointers. >> Not only. If you have cycles, then you'd better rethink the design. >> The difference is between a) graph treated as a mesh (or mess) of nodes >> which "own" each other and b) graph treated as a collection of nodes. >> The former might have ownership cycles between nodes, but not the >> latter, where ownership is an acyclic relation between graph and nodes. >> I agree that this kind of restructuring is not always possible, but for >> me it is conceptually cleaner and worth trying from the beginning. > > I would say that in all cases all references within it should be > non-controlled. The argumentation could go as follows: > > A controlled reference (subject of GC) expresses the life-time relation > "not before me." [*] This relation is obviously transitive (due to nature > of time). Ergo, there cannot be any cycles, per definition. > > From this stand point I would claim that a cycle of controlled references > manifests either a bug or a design problem. That a buggy program continues > to function as-if there were no bug, barely should be attributed as an > advantage of GC systems. Amen! Still, there is a strong argument is that for some class of algorithms it might be beneficial to be able to "drop on the floor" a bigger part of the graph altogether. Consider a situation where an algorithm breaks a connection between two nodes in a graph and just looses the interest in the part that was on the other side of the broken connecion. It might be a single node, but it might be as well million, with mesh (mess) of connections between them. Reclaiming that abandoned part might require implementing the same tracking logic that GC already provides out of the box and therefore the argument goes that the use of off-the-shelf GC can be beneficial for the memory-management aspect of such an algorithm. (Any thoughts on this?) Personally, I accept this reasoning and I'm happy that I *can* plug for example the Boehm collector if I find it useful - but at the same time I don't find this class of algorithms to be so widespread as to justify GC as a general "paradigm", worth exposure as a driving language feature. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/