comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Ada is almost useless in embedded systems
Date: 1996/03/15
Date: 1996-03-15T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.96Mar15155703@spectre.mitre.org> (raw)
In-Reply-To: RALW.96Feb28100925@vulcan.gmrc.gecm.com

In article <RALW.96Mar13101857@vulcan.gecm.com> bill.williams@gecm.com writes:

  > When you're inspecting someone elses code I like the shortcuts that the
  > rich C operators give you. My favourite example has got to be the
  > assignment operators, += etc. Take this (contrived) case...

  > How much easier to *require* (by means of coding standards etc.) the
  > first to be written

  >   bibble_bobble.wibble_wobble += 3;...

  > And what if the coder had actually meant

  > OK, these names are clearly fatuous. But similar cases *do* arise in
  > complex software where, for perfectly sensible reasons a coding standard
  > requires all variables and structure members to have 'meaningful' names.
  > I don't think Ada is immune to this sort of problem.

   No, but the differnce is cultural, not linguistic.  There have been
programs where I needed to do lots of incrementing and declared:

   procedure Inc(X: in out Integer; Y: in Integer := 1) 
   is begin X := X + Y; end Inc;
   pragma Inline(Inc);

   ...and then went and used it all over.  I even had one program that
provided half a dozen similar operations, and instantiated it for
several integer types.  Note that I COULD have written things in terms
of the 'SUCC attribute, but the Ada cultural convention seems to be to
only use 'SUCC and 'PRED for enumeration types, or generic formal
enumeration types.
  
  > > (6) Strong Typing: In the Ada code, the type casting is and must
  > >     be explicity coded.  This provides secure compile-time
  > >     documentation of how big each integer is at each step. This
  > >     is especially useful when you are doing something tricky,
  > >     like writing over memory in a segment register.

  > I approve of strong type *checking*. As we all know (except those
  > who either never write any 'difficult' apps. or never test what
  > they write) type mismatches are a major cause of errors. What
  > irritates me about Ada (and Eiffel is even worse!) is that when *I
  > know* that what I am doing is desirable and correct the language
  > won't let me produce a concise and easily readable expression of
  > it. And, no, I don't consider having to declare my conversion
  > routines in one part of a program so I can use them elsewhere a
  > particularly neat way of solving the problem. Ada deliberately
  > makes it 'unpleasant' to do an unchecked_conversion. IMO it goes a
  > bit too far.

    Ah, but in Ada CHECKED conversions are easy to write and don't
require declarations.  

    In Ada "X := Float(Y);" does just what you would expect, convert Y
to Float and assign it to X.  It is defined for Y of any numeric type.
In fact, when you declare any numeric type you also implicitly create
such a conversion operation.  You also get well defined conversion
operations with derived type declarations, and with many array
declarations.  It is only where you need to convert between types with
no obvious mapping, or when you specifically want no checking, that
you have to resort to Unchecked_Conversion.


					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  parent reply	other threads:[~1996-03-15  0:00 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <823906039.22113@assen.demon.co.uk>
     [not found] ` <4fgrq3$mc4@qualcomm.com>
     [not found]   ` <dewar.823962356@schonberg>
1996-02-17  0:00     ` Ada is almost useless in embedded systems Tore Joergensen
1996-02-17  0:00       ` Robert Dewar
1996-02-19  0:00       ` Keith Thompson
1996-02-19  0:00         ` John McCabe
1996-02-21  0:00           ` Richard A. O'Keefe
1996-02-21  0:00             ` Norman H. Cohen
1996-02-19  0:00 ` Jon S Anthony
1996-02-19  0:00 ` AdaWorks
1996-02-21  0:00   ` Ken Garlington
1996-02-23  0:00     ` AdaWorks
1996-02-19  0:00 ` R.A.L Williams
1996-02-21  0:00   ` Richard A. O'Keefe
     [not found] ` <824056183.18993@assen.demon.co.uk>
     [not found]   ` <311E924E.74CE@escmail.orl.mmc.com>
1996-02-17  0:00     ` Ada is great for embedded systems (was Ada is almost useless in embedded systems) Ken & Virginia Garlington
     [not found]   ` <4fnqpm$3nh@news.sanders.lockheed.com>
1996-02-19  0:00     ` Ada is almost useless in embedded systems AdaWorks
1996-02-21  0:00       ` Ken Garlington
1996-02-21  0:00       ` Hugh Dunne
     [not found]   ` <4fnp37$nj1@theopolis.orl.mmc.com>
1996-02-22  0:00     ` Alan Brain
     [not found] ` <emery-0902962215150001@line316.nwm.mindlink.net>
     [not found]   ` <DMoA85.52I@eskimo.com>
     [not found]   ` <823965654.4500@assen.demon.co.uk>
     [not found]     ` <824165619.14894@assen.demon.co.uk>
     [not found]       ` <JSA.96Feb13133713@organon.com>
     [not found]         ` <824332550.2485@assen.demon.co.uk>
1996-02-17  0:00           ` Ken & Virginia Garlington
1996-02-17  0:00             ` Robert Dewar
1996-02-18  0:00               ` John McCabe
1996-02-18  0:00                 ` Robert Dewar
1996-02-19  0:00                   ` John McCabe
     [not found]         ` <824259217.26321@assen.demon.co.uk>
1996-02-17  0:00           ` Robert Dewar
1996-02-18  0:00             ` John McCabe
1996-02-18  0:00               ` Robert Dewar
1996-02-19  0:00                 ` John McCabe
1996-02-20  0:00                   ` Robert Dewar
1996-02-21  0:00                   ` Fergus Henderson
     [not found]       ` <4fs7ml$cf1@rational.rational.com>
1996-02-26  0:00         ` Ada 83 " Alan Brain
1996-02-26  0:00 ` Ada is almost useless " R.A.L Williams
     [not found]   ` <4h3q56$1vk@goanna.cs.rmit.EDU.AU>
     [not found]     ` <dewar.825635955@schonberg>
     [not found]       ` <826571250.140@assen.demon.co.uk>
     [not found]         ` <dewar.826634800@schonberg>
1996-03-21  0:00           ` John McCabe
1996-03-23  0:00             ` Side-effect arithmetic again [was: Ada ... in embedded systems] John G. Volan
1996-03-23  0:00               ` Robert Dewar
1996-03-25  0:00                 ` Tucker Taft
1996-03-25  0:00                   ` Norman H. Cohen
1996-03-25  0:00                   ` Robert A Duff
1996-03-26  0:00               ` John G. Volan
1996-03-26  0:00                 ` Robert Dewar
1996-03-29  0:00                   ` Robert I. Eachus
1996-03-26  0:00                 ` Robert A Duff
1996-03-26  0:00                   ` Tore Joergensen
1996-03-27  0:00                     ` John G. Volan
1996-03-27  0:00                     ` John G. Volan
1996-03-28  0:00                       ` Tucker Taft
1996-03-28  0:00                         ` Robert Dewar
1996-03-29  0:00                           ` Tucker Taft
1996-03-29  0:00                             ` Tucker Taft
1996-03-27  0:00                     ` John G. Volan
1996-03-29  0:00                       ` Robert A Duff
1996-03-30  0:00                         ` John G. Volan
1996-03-31  0:00                           ` AdaWorks
1996-04-01  0:00                           ` Robert A Duff
1996-03-30  0:00                         ` John G. Volan
     [not found] ` <RALW.96Feb28100925@vulcan.gmrc.gecm.com>
1996-03-15  0:00   ` Robert I. Eachus [this message]
     [not found]     ` <dirk.827148504@demokrit>
1996-03-18  0:00       ` Ada is almost useless in embedded systems David Weller
1996-03-18  0:00     ` Alan Brain
     [not found]       ` <4ik5bm$ogg@dayuc.dayton.saic.com>
1996-03-18  0:00         ` Side-effect arithmetic again [was: Ada ... in embedded systems] Robert Dewar
1996-03-19  0:00           ` Norman H. Cohen
1996-03-19  0:00           ` Jay Martin
1996-03-21  0:00             ` Robert I. Eachus
     [not found]   ` <dewar.825775334@schonberg>
     [not found]     ` <RALW.96Mar8113005@vulcan.gecm.com>
     [not found]       ` <4hv2fb$6ra@cville-srv.wam.umd.edu>
     [not found]         ` <4xybp895y6.fsf@leibniz.enst-bretagne.fr>
     [not found]           ` <3144CC40.33A0@escmail.orl.mmc.com>
     [not found]             ` <dewar.826604375@schonberg>
     [not found]               ` <3145FF2C.6139@escmail.orl.mmc.com>
     [not found]                 ` <dewar.826829407@schonberg>
     [not found]                   ` <31499D21.1DA6@escmail.orl.mmc.com>
1996-03-15  0:00                     ` Bug or Limitation? (was: Ada is almost useless in embedded systems) Robert Dewar
1996-03-16  0:00                       ` Ted Dennison
1996-03-20  0:00                         ` Side-effect arithmetic again [was: Ada ... in embedded systems] Robert I. Eachus
1996-03-20  0:00                           ` John G. Volan
1996-03-22  0:00                             ` Alan Brain
1996-03-20  0:00                           ` Robert A Duff
1996-03-21  0:00                             ` Peter Hermann
1996-03-21  0:00                               ` Robert Dewar
1996-03-25  0:00                                 ` Robert I. Eachus
1996-03-28  0:00                               ` Mats Weber
1996-03-29  0:00                                 ` John G. Volan
1996-03-21  0:00                           ` Geert Bosch
1996-03-26  0:00                           ` Mats Weber
1996-03-16  0:00 ` Ada is almost useless in embedded systems Kevin Dalley
     [not found] <9603131418.AA01642@eight-ball>
1996-03-15  0:00 ` Norman H. Cohen
1996-03-15  0:00   ` Robert Dewar
1996-03-18  0:00   ` Stephen Crawley
1996-03-18  0:00   ` Peter Hermann
1996-03-18  0:00     ` Robert Dewar
1996-03-19  0:00 ` Laurent Guerby
replies disabled

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