comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada syntax questions
Date: Thu, 24 Dec 2020 10:37:10 +0100	[thread overview]
Message-ID: <rs1ng7$17fp$1@gioia.aioe.org> (raw)
In-Reply-To: rs143c$15s$1@franka.jacob-sparre.dk

On 2020-12-24 05:06, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:rrv0u2$102i$1@gioia.aioe.org...
>> On 2020-12-23 02:23, Randy Brukardt wrote:
>>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>>> news:rrs92d$1pfi$1@gioia.aioe.org...
>>> ...
>>>> But you cannot rid of X(...) syntax, where X is an object.
>>>
>>> That's a prefixed view, of course. No one would want to get rid of that.
>>
>> Hmm, where is the operation? A prefixed view is
>>
>>     <expression>.<operation>(...)
>>
>> Indexing is
>>
>>     <expression>(...)
> 
> I neglected to mention that what Ada calls objects are also function calls
> in this proposed generalization.

Well, you must stop the recursion somewhere. It is fine to treat access 
to objects as calls, e.g. to getter/setter, or to indexation, or to 
dereferencing, but you must finish at some point with something spelled 
as a call to a subprogram. In the case of a subprogram call you are 
already there. With "objects" you need a few hops to get there.

  (Much like enumeration literals are in
> Ada.) So for static semantics (that is, compile-time), pretty much
> everything is a function call. This gets rid of the anomalies associated
> with constants (which don't overload and thus hide more than a parameterless
> function - which is otherwise the same thing); combined with
> variable-returning functions, everything is overloadable and treated the
> same in expressions. Almost no special cases (operators still require some
> special casing, but we can make them always visible which would eliminate
> more issues).

Yes, resolving overloading/hiding issues in a uniform way must help.

> Clearly a compiler for this language (which can't be Ada, unfortunately, way
> too incompatible) would special-case some kinds of built-in functions for
> things like objects and indexing. But that doesn't need to hair up the
> semantic model, just the implementations.
> 
> ...
>>> Ada (and most other languages) are full of redundant stuff. Simpilfy the
>>> basics and then one has more room for interesting stuff (static analysis,
>>> parallel execution, etc.).
>>
>> Yes, but I would rather keep all this stuff in the language making it
>> overridable primitive operations.
> 
> Yeah, you don't plan to formally describe nor implement this language, so
> you don't really care about how complex it gets. :-) Well, at least not
> until performance suffers.

Well, if that becomes a part of a library, why should I care?

I would definitely get of generics, and clarify overloading in some way.

> Ada is reaching the limit of what can be done
> without substantial incompatibility. If we're going to allow that, we need
> to start with a cleaner base, and part of that is getting rid of
> redundancies.

We see that differently. So far new features were added on top which 
naturally leads to the mess we observe. The problem is lack of 
generalization not inconsistency. If the new Ada cannot express the old 
messy, but consistent Ada, then this new Ada is not general enough and 
it will arrive at the same amount of mess sooner or later.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2020-12-24  9:37 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 22:39 Ada syntax questions DrPi
2020-12-17 23:18 ` Gabriele Galeotti
2020-12-18  8:26 ` Jeffrey R. Carter
2020-12-18  9:18 ` Dmitry A. Kazakov
2020-12-18 16:55 ` Mart van de Wege
2020-12-18 17:38 ` Björn Lundin
2020-12-18 19:35 ` Niklas Holsti
2020-12-20 21:59   ` Keith Thompson
2020-12-22  1:04     ` Randy Brukardt
2020-12-22  8:00       ` Dmitry A. Kazakov
2020-12-23  1:23         ` Randy Brukardt
2020-12-23  8:59           ` Dmitry A. Kazakov
2020-12-24  4:06             ` Randy Brukardt
2020-12-24  9:37               ` Dmitry A. Kazakov [this message]
2020-12-22 13:48       ` AdaMagica
2020-12-20 21:59   ` Keith Thompson
2020-12-21  8:08     ` Dmitry A. Kazakov
2020-12-18 23:09 ` Stephen Leake
2020-12-19 11:50   ` DrPi
2020-12-19 12:40     ` Dmitry A. Kazakov
2020-12-19 17:13       ` Andreas ZEURCHER
2020-12-19 17:49         ` Dmitry A. Kazakov
2020-12-19 18:40           ` Andreas ZEURCHER
2020-12-19 19:37             ` Dmitry A. Kazakov
2020-12-19 22:11               ` Andreas ZEURCHER
2020-12-20  8:47                 ` Dmitry A. Kazakov
2020-12-20 16:53                   ` Andreas ZEURCHER
2020-12-22  0:58                     ` Randy Brukardt
2020-12-22  2:39                       ` Andreas ZEURCHER
2020-12-22 10:05                     ` Stéphane Rivière
2020-12-25  9:34                     ` G.B.
2020-12-19 17:01     ` AdaMagica
2020-12-19 21:51     ` Stephen Leake
2020-12-19 22:20       ` Andreas ZEURCHER
2020-12-20 14:10       ` DrPi
replies disabled

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