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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.246.236 with SMTP id xz12mr49877514vdc.10.1438289607132; Thu, 30 Jul 2015 13:53:27 -0700 (PDT) X-Received: by 10.140.86.105 with SMTP id o96mr662040qgd.11.1438289607105; Thu, 30 Jul 2015 13:53:27 -0700 (PDT) Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!z61no4265403qge.0!news-out.google.com!78ni391qge.1!nntp.google.com!z61no4265398qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 30 Jul 2015 13:53:26 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.203.145.32; posting-account=AFCLjAoAAABJAOf_HjgEEEi3ty-lG5m2 NNTP-Posting-Host: 81.203.145.32 References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <014427b1-ff7a-4a69-82e6-0330af77ed96@googlegroups.com> <91f88d79-197c-419f-84a8-908e05967a2c@googlegroups.com> <135c2b00-d13c-4f5d-a586-8aca442d363b@googlegroups.com> <87380683vc.fsf@adaheads.sparre-andersen.dk> <347c6be9-c918-4bc0-9494-c93cd6740def@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4cb32c40-f659-490d-bbb6-73585fc069e8@googlegroups.com> Subject: Re: Running a preprocessor from GPS? From: EGarrulo Injection-Date: Thu, 30 Jul 2015 20:53:27 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:194551 Date: 2015-07-30T13:53:26-07:00 List-Id: On Thursday, July 30, 2015 at 9:29:38 PM UTC+2, Jeffrey R. Carter wrote: > On 07/30/2015 01:37 AM, EGarrulo wrote: > > > > Hence, where is the magic please? So far, I know that programming > > languages either offer garbage collection (and that works only for > > memory), or some kind of reference-counting (and that works for > > everything, but it requires some planning). > > > > Yet, ironically, hardly ever somebody explains how a programming > > language is meant to be used. You are always supposed to magically "get it". > > And we're supposed to magically know what you think cannot be done in Ada > without manual memory management. You have mentioned "shared resources" a couple > of times without defining what a "resource" is or what it's shared between. > Maybe you mean sharing a data structure between tasks, though anyone who > understands Ada knows how to do that without access types or manual memory > management. In Ada one can implement many recursive data structures without > access types or manual memory management. Maybe that's what you mean. By "resource" I mean any resource -- like: database connections, files, etc. -- that must be relinquished as soon as possible and that is shared among different objects, in a way that makes it difficult for each object to determine whether such resource is still needed by other objects or not. Of course, this implies a dynamic environment that precludes the possibility of creating all the needed resources in advance and then releasing them at the end of computation. > It's clear you come from a C/++ background, and I suspect you are thinking in > C/++ terms. I am not thinking in C++ terms. I am thinking in terms of patterns that I know for managing resources. So far, I only know the "shared/weak pointer" idiom. If Ada offers something else, besides manual reclamation, I am eager to learn about it.