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!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Implementing Rust's borrow checked pointers Date: Tue, 24 Sep 2019 12:13:30 -0700 Organization: None to speak of Message-ID: References: <5edf39fb-169a-463a-b28e-ece1d3b553e0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="28292d79cbf11d7f5785c7d4405154cb"; logging-data="26268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zuGXu0ezplRkRnGkwDk2N" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:18XhuLxllNmwWtntdvaYJQRehnc= sha1:K3FSDmHuZFfbILby22owsT+DlKk= Xref: reader01.eternal-september.org comp.lang.ada:57185 Date: 2019-09-24T12:13:30-07:00 List-Id: Lucretia writes: > On Tuesday, 24 September 2019 12:23:30 UTC+1, Optikos wrote: > >> > begin >> > A.all ... ; -- raises exception. >> >> 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. Can you provide a specific citation? 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. (I've seen compile-time exceptions, but they were compiler bugs, not diagnostics for the program being compiled.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */