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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: The answer to "Can Ada replace FORTRAN for numerical computation? Date: Wed, 24 Jul 2019 18:45:26 -0500 Organization: JSA Research & Innovation Message-ID: References: <4ba1579b-a096-483d-8f7a-9028a419d643@googlegroups.com> <28590d5c-d5f0-4322-9aa4-e1bb92419db3@googlegroups.com> Injection-Date: Wed, 24 Jul 2019 23:45:27 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="29781"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:56933 Date: 2019-07-24T18:45:26-05:00 List-Id: "Lucretia" wrote in message news:28590d5c-d5f0-4322-9aa4-e1bb92419db3@googlegroups.com... ... > Something like: > > M2 := M4 (1, 1 .. 2, 2); -- Makes a copy into the Matrix 2x2 type from a > 4x4. This is no problem, of course. What is a problem is the fact that one can assign into these things and (especially) pass them as "in out" parameters. That causes overhead for all parameter passing of arrays, whether or not a multidimensional slice is ever actually used (the compiler cannot assume that array components are contiguous). Array slices is one of the features I would remove from "Better Ada". Most of their utility comes from strings, and (modern) strings are not arrays in the first place. (I'd also get rid of arrays as a built-in type, making them a form of container.) A side-effect of that would be to get rid of the continuing discussion of this "obvious" extension that is way too expensive to have in Ada (or any language, for that matter). Subprograms can easily provide the "cheap" functionality, and no one really intends to use expensive code anyway. Randy.