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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11232c,59ec73856b699922 X-Google-Attributes: gid11232c,public X-Google-Thread: fdb77,5f529c91be2ac930 X-Google-Attributes: gidfdb77,public X-Google-Thread: 1108a1,59ec73856b699922 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-01 18:27:45 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: softeng3456@netscape.net (soft-eng) Newsgroups: comp.lang.java.advocacy,comp.object,comp.lang.ada,misc.misc Subject: Re: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died) Date: 1 May 2003 18:27:44 -0700 Organization: http://groups.google.com/ Message-ID: <9fa75d42.0305011727.5eae0222@posting.google.com> References: <9fa75d42.0304230424.10612b1a@posting.google.com> <3EA7E0E3.8020407@crs4.it> <9fa75d42.0304240950.45114a39@posting.google.com> <4a885870.0304291909.300765f@posting.google.com> <416273D61ACF7FEF.82C1D1AC17296926.FF0BFD4934A03813@lp.airnews.net> <9fa75d42.0305010621.55e99deb@posting.google.com> <254c16a.0305011035.13133e8d@posting.google.com> NNTP-Posting-Host: 12.243.127.233 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1051838865 8465 127.0.0.1 (2 May 2003 01:27:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 2 May 2003 01:27:45 GMT Xref: archiver1.google.com comp.lang.java.advocacy:63018 comp.object:62513 comp.lang.ada:36830 misc.misc:13883 Date: 2003-05-02T01:27:45+00:00 List-Id: mcq95@earthlink.net (Marc A. Criley) wrote in message news:<254c16a.0305011035.13133e8d@posting.google.com>... > Ada is a language whose definition is built around the concept of a > "type model". Yes, it used the then modern concepts of type definition. (Later superseded by notions of object-oriented type definitions.) > Now for a comparable properly defined Ada type, one has the following: > > - The first and last values ('First and 'Last) > - Access to the previous and next valid values ('Pred and 'Succ) > - Conversion of the type to a string--without having to know its > size or whether it's floating, numeric, or enumeration ('Image > and 'Wide_Image) > - The maximum number of characters such a string representation can > take ('Width and 'Wide_Width) > - Ability to convert a string representation of that type--whatever > kind it is--back to a value--with range checking! ('Value, > 'Wide_Value) > - The number of bits required to hold the type's largest value ('Size) > > If you have a variable of that type, at the very least you get: > - The number of bits actually allocated for that value ('Size) > - It's address ('Address) Yes, Ada extended Pascal very strongly in this regards, without any particular consideration of how useful these extensions would actually turn out to be. > If you know a little bit more about your type, specifically whether > it's a discrete or floating point type, what else do you get with > C/C++? Nothing. > > With Ada (discrete): > - 'Pos, the ordinal position of an enumeral (or number) > - 'Val, convert an ordinal position into a value of the type > > (floating): > - 'Machine_Mantissa > - 'Machine_Radix > and it goes on... > > (And yes, one could write a CAltitude class that provides all this > information, but one would have to implement and debug > _all_of_those_functions. In Ada you write: > > type Altitude is digits 6.0 range -100.0 .. 50_000.0; > > and you get access to all that information for free!) Like I said, Ada has amazing amounts of itsy-bitsy stuff. Now which of these features, if missing, would take you more than a minor effort to provide yourself? If and when necessary, rather than present by default all the time? > understood the motivation for, and power of, strong typing (such as it > is in C++, Java, or Ada) much better software would get written, and > the "best" programmers wouldn't be struggling to work around it. You misunderstand. Nobody needs to "work around" the type-safety of C++ or Java. Though this was a problem with Pascal, which was the premier contender at one time. The need to "work around" Pascal's type safety was a big problem, and that helped C become much more popular. Ada didn't just inherit Pascal's problems, it enthusiastically extended them. The type safety in C++ and therefore in Java has evolved slowly and naturally.