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 X-Received: by 2002:a37:a695:: with SMTP id p143mr4554666qke.144.1569356124028; Tue, 24 Sep 2019 13:15:24 -0700 (PDT) X-Received: by 2002:a9d:744d:: with SMTP id p13mr3416572otk.76.1569356123758; Tue, 24 Sep 2019 13:15:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!o24no5643863qtl.0!news-out.google.com!q23ni320qtl.1!nntp.google.com!o24no5643855qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 24 Sep 2019 13:15:23 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.223.245; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.223.245 References: <5edf39fb-169a-463a-b28e-ece1d3b553e0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Implementing Rust's borrow checked pointers From: Optikos Injection-Date: Tue, 24 Sep 2019 20:15:24 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57186 Date: 2019-09-24T13:15:23-07:00 List-Id: On Tuesday, September 24, 2019 at 2:13:33 PM UTC-5, Keith Thompson wrote: > Lucretia writes: > > On Tuesday, 24 September 2019 12:23:30 UTC+1, Optikos wrote: > > > >> > begin > >> > A.all ... ; -- raises exception. > >>=20 > >> No, to be as useful as Rust's borrow checker, instead of raising > >> exception, it needs to be a compile-time error. The compiler needs > >> to maintain a whole-program directed graph at compile-time, not defer > >> a detection-based localized analysis to run-time. > > > > Yes, the compiler would raise that exception at compile time. This > > idea that all exceptions are raised at runtime is false and you should > > check the AARM. >=20 > Can you provide a specific citation? >=20 > Certainly a compiler can diagnose an error at compile time, but I've > never heard that referred to as an "exception". And a compiler can > generate code that unconditionally raises an exception, but that code is > executed at run time. >=20 > (I've seen compile-time exceptions, but they were compiler bugs, not > diagnostics for the program being compiled.) >=20 > --=20 > Keith Thompson (The_Other_Keith) kst-u@mib.org > Will write code for food. > void Void(void) { Void(); } /* The recursive call of the void */ Keith, I already did in a prior posting above, but you apparently blocked m= e, so your loss. Here is the answer to your question again for all other r= eaders: =C2=A71.1.5 Classification of =E2=80=A2Errors =E2=80=9CIf such an = =E2=80=A2error=E2=80=A2 situation is certain to arise in every execution of= a construct, then an implementation is =E2=80=A2=E2=80=A2=E2=80=A2allowed = (although not required)=E2=80=A2=E2=80=A2=E2=80=A2 to report this fact at = =E2=80=A2compilation=E2=80=A2 time.=E2=80=9D