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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to "cross the chasm"? Date: Sat, 05 May 2018 17:12:08 -0700 Organization: A noiseless patient Spider Message-ID: <87tvrl63s7.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <94bd81e5-2ef5-41a2-973a-72f2ba4cecd1@googlegroups.com> <721a01f5-569a-4cec-b0e9-62d19e1443fb@googlegroups.com> <431526826.547202380.696445.laguest-archeia.com@nntp.aioe.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="37995cf217b8b07e8c121df0d5a3fb96"; logging-data="25853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NRpi75Hd3JO/5z2YMlmF1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:oSs5lljqvIjthl5v75TDApaAhXM= sha1:Cf+3aWB1CXS2JI+jT0dVTxO1OkM= Xref: reader02.eternal-september.org comp.lang.ada:52025 Date: 2018-05-05T17:12:08-07:00 List-Id: Luke A. Guest writes: > I have to agree with this, this should be a high priority imo. Especially > since everyone and their dogs are jumping on the Rust bandwagon, this could > shut them up. Is this something like C++ std::unique_ptr except the compiler is supposed to enforce 1) you never call something like .get() which extracts an unrestricted pointer, and 2) you can never use a unique_ptr variable if you've transferred away the ownership with the equivalent of std::move (ordinary assignment in the AI example)? In C++ doing that is a runtime error, which isn't ideal. 1) seems easy, 2) looks very useful but might have far-reaching implications for the compiler type checker. Would it need something like Rust's affine types? I don't know how they work but if Ada got them, maybe they could be used in lots of other ways as well.