comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Why no Ada.Wide_Directories?
Date: Fri, 21 Oct 2011 15:41:59 +0200
Date: 2011-10-21T15:41:59+02:00	[thread overview]
Message-ID: <5279agttaub8.1pl7pt496l1am$.dlg@40tude.net> (raw)
In-Reply-To: op.v3pcqxj8ule2fv@index.ici

On Fri, 21 Oct 2011 14:53:11 +0200, Yannick Duch�ne (Hibou57) wrote:

> Le Thu, 20 Oct 2011 19:35:21 +0200, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a �crit:

>>> What's missing from Interface type introduced with Ada 2005 ?
>>
>> 1. Most Ada types do not have interfaces
> Eiffel has this, and this is 1) not perfect (may lead to performance  
> issue) 2) rarely used in practice

There is no performance loss.

>> 2. Ada interface cannot be inherited from a concrete type
> You can have a concrete implementation, why is that not enough ?

Because it is not what required: you have a concrete type and want to name
its interface to inherit from, only the interface or its part.

>> 3. Ada interface cannot have implementation
> Derived types can. Why is that a trouble is one inheritance level is  
> purely abstract ?

Why I am forced to have it? If you have a reason, the implication is that
*each* type must have two declarations: the interface and the type itself.
Note that this does not solve the problem, because it would not give
partial interfaces.

The problem is fragile design: you don't know in advance all interfaces the
users of the package might you later on. It is very bad for large system
design.

>> 4. Ada interface does not support ad-hoc supertypes
> Can you tell more with an example ? (I don't know what supertypes are)

If A is a subtype of B, then B is a supertype of A. Subtype imports
operations, supertype exports them.

Ad-hoc means that you can hang on supertypes on existing types, e.g. coming
from a library, which cannot be changed. Doing so you could bring such
unrelated types under one roof, e.g. to be able to put them into a
container etc.

>> Not an issue. Scalar types may have interfaces at zero time/space cost. You
>> don't need to embed tag into by-value types.
> This is possible indeed, but at the cost of separate compilation.

It is possible without that.

>>>> Any syntax sugar (prefix notation, infix operations,
>>>> assignments, indexing, member extraction, aggregates, entries,
>>>> attributes) shall be operations.
>>> Are you sure you are not confused between concrete syntax and abstract
>>> syntax ?
>>
>> I don't understand this. The problem is that, for example, for the record
>> type T and its member A, the ".A" is not the operation of T, because record
>> is not an interface. A'First is not an operation of array. ":=" is not an
>> operation (doubly dispatching) of its left and right sides etc.
> 
> Same feeling as above. Seems you are looking for something which is higher  
> level than Ada is.

It is not higher level, it is just regular language. Ada 83 was designed in
the times when type systems were pretty fresh stuff. It bears marks of
elder languages which had only built-in types.

> May  
> be worth to recall Ada is not a modeling language, but an implementation  
> language with features to enforce safety as much as possible.

You mean that lacking constructors, user-defined assignment, safe
finalization adds something to safety? That must be a very strange kind of
safety then...

>>> This is not a language topic, instead, a technology level topic. I feel
>>> runtime check is a reasonable fall-back for what cannot be statically
>>> checked in th actual state of the technology.
>>
>> No, it is inconsistent and unreasonable. Static checks are meant to  
>> detect bugs. Bug is either there or not, independently on whether the  
>> program is running, not running, will ever run.
> Easy to say, less to do. You did not demonstrate this is not related to  
> actual technology, you just complained it is not as you wish.

No, I complained that self correctness check is inconsistent.

As for raising exceptions from run-time checks, that plague is well known
to anybody who ever used access types. ARG keeps on struggling to repair
the damage made in Ada 95, while breaching another, bigger hole in the
language...

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



  reply	other threads:[~2011-10-21 13:41 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14  6:58 Why no Ada.Wide_Directories? Michael Rohan
2011-10-14  7:39 ` Yannick Duchêne (Hibou57)
2011-10-14  9:07   ` Dmitry A. Kazakov
2011-10-14 12:48     ` Yannick Duchêne (Hibou57)
2011-10-14 12:54     ` Yannick Duchêne (Hibou57)
2011-10-15  1:06 ` ytomino
2011-10-15  6:55   ` Vadim Godunko
2011-10-15 12:34     ` ytomino
2011-10-15  8:38   ` Dmitry A. Kazakov
2011-10-15 13:12     ` Peter C. Chapin
2011-10-15 13:22       ` Ludovic Brenta
2011-10-15 14:47       ` Dmitry A. Kazakov
2011-10-16  5:48         ` Yannick Duchêne (Hibou57)
2011-10-17  0:15         ` Peter C. Chapin
2011-10-17  3:23           ` Yannick Duchêne (Hibou57)
2011-10-17  7:12           ` Simon Wright
2011-10-17  7:59           ` Dmitry A. Kazakov
2011-10-18 10:55             ` Peter C. Chapin
2011-10-18 12:27               ` Dmitry A. Kazakov
2011-10-16  5:51       ` Yannick Duchêne (Hibou57)
2011-10-17 21:41         ` Randy Brukardt
2011-10-18  7:29           ` Dmitry A. Kazakov
2011-10-18 14:06           ` Pascal Obry
2011-10-18 14:08             ` Pascal Obry
2011-10-19 21:32             ` Randy Brukardt
2011-10-17 21:33   ` Randy Brukardt
2011-10-17 23:47     ` ytomino
2011-10-18  1:10       ` Adam Beneschan
2011-10-18  2:32         ` ytomino
2011-10-18  4:46           ` ytomino
2011-10-18  9:32             ` Yannick Duchêne (Hibou57)
2011-10-18 10:00               ` Dmitry A. Kazakov
2011-10-18 10:06                 ` Yannick Duchêne (Hibou57)
2011-10-18 12:01                   ` Dmitry A. Kazakov
2011-10-18 15:02           ` Adam Beneschan
2011-10-18 15:16             ` Dmitry A. Kazakov
2011-10-18 23:42               ` Adam Beneschan
2011-10-19  8:12                 ` Dmitry A. Kazakov
2011-10-19 21:43               ` Randy Brukardt
2011-10-20  7:37                 ` Dmitry A. Kazakov
2011-10-20 11:04                   ` Yannick Duchêne (Hibou57)
2011-10-20 12:21                     ` Dmitry A. Kazakov
2011-10-20 12:38                       ` Yannick Duchêne (Hibou57)
2011-10-20 14:31                         ` Dmitry A. Kazakov
2011-10-20 15:54                           ` Yannick Duchêne (Hibou57)
2011-10-20 17:35                             ` Dmitry A. Kazakov
2011-10-21 12:53                               ` Yannick Duchêne (Hibou57)
2011-10-21 13:41                                 ` Dmitry A. Kazakov [this message]
2011-10-25 19:22                                   ` Randy Brukardt
2011-10-25 19:35                                     ` Dmitry A. Kazakov
2011-10-26 22:41                                       ` Randy Brukardt
2011-10-27  7:43                                         ` Dmitry A. Kazakov
2011-10-27 15:13                                           ` Yannick Duchêne (Hibou57)
2011-10-27 19:39                                             ` Robert A Duff
2011-10-27 21:09                                               ` Yannick Duchêne (Hibou57)
2011-10-28  7:50                                                 ` Dmitry A. Kazakov
2011-10-28  8:45                                                   ` Yannick Duchêne (Hibou57)
2011-10-28 14:59                                                     ` Dmitry A. Kazakov
2011-10-20 17:40                   ` J-P. Rosen
2011-10-20 18:43                     ` Dmitry A. Kazakov
2011-10-21 10:07                     ` Vadim Godunko
2011-10-21 11:25                       ` J-P. Rosen
2011-10-21 12:25                         ` Yannick Duchêne (Hibou57)
2011-10-21 13:13                         ` Dmitry A. Kazakov
2011-10-21 16:03                           ` Yannick Duchêne (Hibou57)
2011-10-21 18:34                             ` Dmitry A. Kazakov
2011-10-21 19:30                               ` Yannick Duchêne (Hibou57)
2011-10-21 20:02                                 ` Dmitry A. Kazakov
2011-10-21 20:36                                   ` Yannick Duchêne (Hibou57)
2011-10-22  7:54                                     ` Dmitry A. Kazakov
2011-10-22 20:28                                       ` Yannick Duchêne (Hibou57)
2011-10-22 22:23                                       ` Yannick Duchêne (Hibou57)
2011-10-23  7:53                                         ` Dmitry A. Kazakov
2011-10-25 19:16                                           ` Randy Brukardt
2011-10-21 18:55                         ` Vadim Godunko
2011-10-21 19:18                           ` J-P. Rosen
2011-10-21 19:41                           ` Yannick Duchêne (Hibou57)
2011-10-18 22:54             ` ytomino
2011-10-18  3:15         ` Yannick Duchêne (Hibou57)
2011-10-18  7:55         ` Dmitry A. Kazakov
2011-10-18  9:41           ` Yannick Duchêne (Hibou57)
2011-10-18 10:25           ` J-P. Rosen
2011-10-18 10:56             ` Yannick Duchêne (Hibou57)
2011-10-18 15:34           ` Adam Beneschan
2011-10-18 17:27             ` J-P. Rosen
2011-10-18 18:33               ` Adam Beneschan
2011-10-18 19:54               ` Yannick Duchêne (Hibou57)
2011-10-18  8:01       ` Dmitry A. Kazakov
2011-10-18  2:59     ` Yannick Duchêne (Hibou57)
2011-10-18  4:07       ` Michael Rohan
2011-10-18  4:54       ` ytomino
2011-10-18  9:54         ` Yannick Duchêne (Hibou57)
2011-10-18 10:52           ` ytomino
2011-10-18 11:02             ` Yannick Duchêne (Hibou57)
2011-10-18 21:18               ` ytomino
2011-10-18 10:10       ` J-P. Rosen
2011-10-22  6:32         ` Michael Rohan
2011-10-22  7:25           ` Yannick Duchêne (Hibou57)
2011-10-25 19:26           ` Randy Brukardt
2011-10-27 17:40 ` anon
replies disabled

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