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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5bcc293dc5642650 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.8.135 with SMTP id r7mr15318999pba.8.1319204516409; Fri, 21 Oct 2011 06:41:56 -0700 (PDT) Path: d5ni39695pbc.0!nntp.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why no Ada.Wide_Directories? Date: Fri, 21 Oct 2011 15:41:59 +0200 Organization: cbb software GmbH Message-ID: <5279agttaub8.1pl7pt496l1am$.dlg@40tude.net> References: <9937871.172.1318575525468.JavaMail.geo-discussion-forums@prib32> <418b8140-fafb-442f-b91c-e22cc47f8adb@y22g2000pri.googlegroups.com> <7156122c-b63f-487e-ad1b-0edcc6694a7a@u10g2000prl.googlegroups.com> <409c81ab-bd54-493b-beb4-a0cca99ec306@p27g2000prp.googlegroups.com> <1rlz5gwqmeizn$.fwqpl0mhzf54$.dlg@40tude.net> <1w7i4ekc7yvjx$.60o908ry5lhc$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: NkTZyZQzt+uRNthfI6+Hjg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:18643 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2011-10-21T15:41:59+02:00 List-Id: 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 > 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