comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: The answer to "Can Ada replace FORTRAN for numerical computation?
Date: Wed, 24 Jul 2019 18:45:26 -0500
Date: 2019-07-24T18:45:26-05:00	[thread overview]
Message-ID: <qhaqin$t2l$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 28590d5c-d5f0-4322-9aa4-e1bb92419db3@googlegroups.com

"Lucretia" <laguest9000@googlemail.com> 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.


  reply	other threads:[~2019-07-24 23:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  4:38 The answer to "Can Ada replace FORTRAN for numerical computation? Nasser M. Abbasi
2019-07-22  5:53 ` Simon Wright
2019-07-22 10:32   ` Lucretia
2019-07-22 13:20     ` Simon Wright
2019-07-22 17:27       ` Lucretia
2019-07-24 23:45         ` Randy Brukardt [this message]
2019-08-15 16:45           ` Norman Worth
2019-08-15 19:07             ` Dmitry A. Kazakov
2019-08-16 18:29               ` Norman Worth
2019-08-16 19:23                 ` Dmitry A. Kazakov
2019-08-18 17:04                   ` Norman Worth
2019-07-23  1:35 ` Brad Moore
2019-07-23 23:42 ` Jerry
2019-08-03 12:30 ` Nasser M. Abbasi
2019-08-05 14:35   ` Shark8
2019-08-05 17:15     ` Optikos
2019-08-07  6:35       ` Niklas Holsti
2019-08-07 20:42         ` Optikos
2019-08-16 19:11           ` Norman Worth
2019-08-16 20:15             ` Jeffrey R. Carter
2019-08-17  2:38             ` robin.vowels
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox