From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: New aggregates with Ada 2022.
Date: Fri, 24 Jun 2022 22:13:44 -0500 [thread overview]
Message-ID: <t95uha$edq$1@dont-email.me> (raw)
In-Reply-To: t93mr6$pvm$1@gioia.aioe.org
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t93mr6$pvm$1@gioia.aioe.org...
> On 2022-06-24 03:24, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:t91buq$10im$1@gioia.aioe.org...
>>> On 2022-06-23 03:06, Randy Brukardt wrote:
>> ...
>>>> (How something gets implemented should not be part of a language
>>>> design, so long as the design does not prevent an efficient
>>>> implementation.)
>>>> I certainly would not treat them as special in any way, just a series
>>>> of
>>>> function calls. (Possibly records could be treated that way as well,
>>>> although it is less clear that an efficient implementation is possible
>>>> for
>>>> them.)
>>>
>>> Syntax sugar for subprogram calls is not enough because it does not
>>> allow
>>> generic programming. One should be able to write a program that deals
>>> with
>>> any instance of the interface. Like a generic body working with any
>>> actual
>>> array or a class-wide body which unfortunately is impossible to have for
>>> arrays presently.
>>
>> You're thinking too small. Obviously, in a language without an syntactic
>> array construct, every data structure would be some sort of record.
>
> They are fundamentally different. Record interface is static mapping:
>
> identifier -> value
>
> 1D array interface is dynamic mapping:
>
> ordered value -> value
>
> It not only has run-time semantics of (indexing). It is also ordering of
> the index which implies enumeration, ranges, slices.
Dymanic means a function. And there is no reason to treat a few functions as
special (again, at the user level).
Something purely-compile time (like the selection of record components)
clearly needs some special semantics. Not so clear with dynamic things.
>> So
>> class-wide operations would be available for all of those -- and without
>> all
>> of the complications of a separate formal array type. The idea is to have
>> one mechanism for pretty much everything, and let the compiler sort out
>> the
>> results. Back when we created Janus/Ada, that wasn't really practical
>> because of memory and CPU speed constraints, but none of that holds true
>> anymore. Simplify the language, complicate the compiler!
>
> I don't buy the idea of run-time penalty for having abstract data types
> and I don't see why built-in arrays cannot coexist with user-defined ones
> without turning the language into LISP.
They add a huge amount of complication for very little gain. One could
simplify them (getting rid of mistaken features like slices), but you still
would want a user-defined version. And once you have that, you no longer
need a special version - you just have some predefined versions (just like
Ada handles operators).
> Furthermore, the age of free CPU cycles came to an end. Soon we will have
> return back to sanity.
I don't think programming abstractly and translating that into good code
will ever be a bad idea. After all, that is the idea behind Ada. If you
truly want to worry about the cost of compilation, then you have program in
a very close to the metal language, even lower level than C. And current
machines are way harder to generate code for than the Z-80 that we started
out on (and even then, we generated pretty bad code with the very tiny
compiler).
I'd rather plan for a future where the compiler tool set does a lot of
correctness checking for one's programs; code generation will always be much
cheaper than that (especially if you do not need bleeding edge performance).
Simplify (and abstract) the language, complicate the compiler!
Randy.
next prev parent reply other threads:[~2022-06-25 3:13 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-19 7:59 New aggregates with Ada 2022 Blady
2022-06-19 14:15 ` Simon Wright
2022-06-20 19:36 ` Blady
2022-06-20 22:01 ` Simon Wright
2022-06-20 21:47 ` Randy Brukardt
2022-06-20 22:18 ` Dmitry A. Kazakov
2022-06-21 23:28 ` Randy Brukardt
2022-06-22 9:04 ` Dmitry A. Kazakov
2022-06-23 1:06 ` Randy Brukardt
2022-06-23 9:32 ` Dmitry A. Kazakov
2022-06-23 10:53 ` G.B.
2022-06-24 1:21 ` Randy Brukardt
2022-06-24 1:24 ` Randy Brukardt
2022-06-24 6:50 ` Dmitry A. Kazakov
2022-06-25 3:13 ` Randy Brukardt [this message]
2022-06-25 8:50 ` Dmitry A. Kazakov
2022-06-27 21:37 ` Randy Brukardt
2022-06-28 5:36 ` Niklas Holsti
2022-06-29 4:01 ` Randy Brukardt
2022-06-29 8:30 ` Jeffrey R.Carter
2022-06-29 9:04 ` Dmitry A. Kazakov
2022-06-30 5:03 ` Randy Brukardt
2022-06-30 8:44 ` Dmitry A. Kazakov
2022-06-29 11:06 ` Niklas Holsti
2022-06-29 12:53 ` Jeffrey R.Carter
2022-06-30 5:07 ` Randy Brukardt
2022-06-30 5:14 ` Randy Brukardt
2022-06-30 8:31 ` Marius Amado-Alves
2022-07-01 5:20 ` Randy Brukardt
2022-06-30 10:30 ` Jeffrey R.Carter
2022-06-30 15:48 ` Marius Amado-Alves
2022-06-30 16:39 ` Jeffrey R.Carter
2022-07-01 0:07 ` Marius Amado-Alves
2022-06-28 7:52 ` Dmitry A. Kazakov
2022-06-29 4:07 ` Randy Brukardt
2022-06-29 7:24 ` Dmitry A. Kazakov
2022-06-30 5:00 ` Randy Brukardt
2022-06-21 23:39 ` Randy Brukardt
2022-06-22 8:26 ` Dmitry A. Kazakov
2022-06-23 1:10 ` Randy Brukardt
2022-06-23 9:32 ` Dmitry A. Kazakov
2022-06-20 22:10 ` Jesper Quorning
2022-06-20 22:59 ` Jesper Quorning
2022-06-21 23:20 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox