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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Tue, 8 May 2018 23:46:03 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com> <87o9i2pkcr.fsf@nightsong.com> <87in88m43h.fsf@nightsong.com> <87efiuope8.fsf@nightsong.com> <87lgd1heva.fsf@nightsong.com> <87zi1gz3kl.fsf@nightsong.com> <878t8x7k1j.fsf@nightsong.com> <87k1sg2qux.fsf@nightsong.com> NNTP-Posting-Host: kQkuQcRDy1QFvWpyB1foYw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:52137 Date: 2018-05-08T23:46:03+02:00 List-Id: On 2018-05-08 23:28, Niklas Holsti wrote: > On 18-05-07 10:25 , Dmitry A. Kazakov wrote: >> On 07/05/2018 03:31, Paul Rubin wrote: >>> "Dmitry A. Kazakov" writes: >>>> This is easily done in present Ada using handles to a >>>> reference-counted objects. >>> >>> That's not much different from gc from the user's perspective, other >>> than problems handling cycles. >> >> Cycles are easily avoidable too by separating target objects and >> handles. All target objects types go into the private part of the >> package. When only handles are visible there is no way the end user >> could construct a cycle. > > True for a single such data structure; much harder if the client > combines different, independently implemented data structures and > stores, in one structure, handles that point at the other structure, and > perhaps in the other direction too. Since the implementations of the two > data structures are ignorant of each other's existence, neither can > detect such cross-structure cycles, I believe. Yes, but that is a bad design anyway. I would say that all such cases fall into the category when references going in one direction are strong and the backward ones are weak. > GC-based languages handle such cross-structure cycles in the same way as > within-structure cycles. Yes, but my argument is that it only hides the logical error. The reference that is semantically weak acts as a strong one preventing collection of an unused object. Circular references are never right. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de