From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: ada and robots
Date: 1997/06/17
Date: 1997-06-17T00:00:00+00:00 [thread overview]
Message-ID: <33A69E46.3230@gsfc.nasa.gov> (raw)
In-Reply-To: 33A5D644.37A3@epix.net
Matthew S. Whiting wrote:
( second hand list of supposed Ada deficiencies )
> >* Ada's strong typing does not allow very complex structures to b=
e
> >manipulated and/or used efficiently due to its typing scheme (which in=
turn
> >causes a programmer to code many more lines of code, or to structure a=
> >particular data set in a ineffective manner, or not at all).
This is not specific enough; for a counter argument, see the Ada Booch
components, at: http://www.rivatech.com:80/booch/
> >* Ada does not support discriminant unions (which are extremely u=
seful,
> >almost required). In fact, discriminant union support is required with=
in the
> >data structures that are used within the [one of our systems] data arc=
hitecture; >and in fact,
> >are very critical for supporting applications that need to support man=
y data
> >types within a limited memory area. Ada does have some hacks to get ar=
ound
> >some of these issues (using the USE AT construct) but still can not ge=
t
> >around certain design issues. For example, if a designer wanted to bui=
ld a
> >data area that would store strings, booleans, ints, longs, float, and =
doubles
> >all under one type called MyType (which was defined as a structure tha=
t
> >contained a type discriminant, and a union to hold the desired value) =
and
> >then pass an array of these elements (with mixed types) to a routine f=
or
> >processing=85 A Ada programmer might as well forget it=85 Also, I bel=
ieve this
> >is an issue when declaring an object array with Ada95 where all elemen=
ts must
> >be of the defined type; yet using the C++ array template, one may stor=
e
> >objects of different types into the same array.
This is precisely the Ada discriminant record:
type Label_Type is (String, Boolean, Int, Float);
type MyType (Label : Label_Type :=3D String) is record
case Label is
when String =3D>
String_Value : String (1 .. 80);
when Boolean =3D>
Boolean_Value : Boolean;
when Int =3D>
Int_Value : Integer;
when Float =3D>
Float_Value : Float;
end case;
end record;
These can be stored in an array.
=
> >* Ada does not support conforment arrays. You can not pass an arr=
ay with 5
> >elements to a routine one time and then pass an array of 10 elements t=
he next
> >because of the typing. This is an extremely critical aspect that is ex=
tremely
> >difficult to get around within Ada compared with C/C++ or Pascal. More=
over,
> >this functionality is almost required when processing communications p=
ackets
> >that may be variable-sized.
Wrong again; this is precisely what a String is! The Ada terminology is
"unconstrained arrays".
type String is array (POSITIVE range <>) of character;
procedure Put (Item : in String);
> >* Ada does not support variable length parameter lists. This is a=
very tacky
> >aspect of the language, which in turn, causes many more lines of code =
to be
> >generated to support some functionality that requires different data i=
nputs.
> >This limitation can greatly effect a programs function (overload) coun=
t due
> >to this limitation. =
This is true. The reason is type safety and run-time simplicity. When
porting GCC to a new processor, one of my biggest problems was getting
variable arguments working; I'm still finding bugs related to this! But
even given a correct implementation, variable argument lists are just
not type safe. Ada provides alternatives that are safe (see MyType
above).
> >* DCOM (which OPC will be based) uses DCE IDL. DCE IDL is a super=
set of CORBA
> >IDL and offers many complex data types that are essential for low-leve=
l,
> >high-performance system applications that are not supported in Ada, Ja=
va, =85
> >This lack or inability of the language to handle complex data structur=
es can
> >again increase the lines of coding.
What are the specific types that DCOM requires that (supposedly) cannot
be defined in Ada? This is arguing from ignorance.
> >* Interface Packages - Another extremely dangerous issue with Ada=
is the fact
> >that under certain OS's we may be required to write the interface bind=
ings to
> >vendor routines, and these may not be commercially available. And look=
ing at
> >our current IO vendors, they appear to be supplying C/C++ libraries, w=
hich
> >almost guarantees that we will need C bindings to what OS we're using.=
> >VxWorks may have bindings, but what about pSOS, and other potential OS=
's. I
> >do not see to many IO vendors supplying Ada routines for the hardware=85=
This is not an argument against the language itself, but it is relevant.
Currently, there are more bindings available for C; projects that use
Ada will have to write bindings themselves. This will change as Ada
becomes more popular.
A side benefit of writing your own bindings is that you become more
aware of the details of the system you are binding to; this is sometimes
a good thing.
> >
> >
> >Here are just a few items that truly make Ada very ineffective and
> >inefficient to program in =85 And many of them focus around the inabil=
ity of
> >the language to support complex (but required) data structures and typ=
es, as
> >well as, the intolerable type scheme. =
Ada supports all the complex data structures and types that C does;
please give real examples! The fact that one programmer finds the strong
typing "intolerable" does not mean it is not up to the job.
> >The fact the Ada has the following
> >semantics: USE AT, Unchecked_Conversion, Unchecked_Access, and
> >Unchecked_Deallocation; one might ask why Ada needs such dangerous ele=
ments
> >within the language unless they are required so that the language can =
perform
> >certain tasks (which require them). Once elements such as these are us=
ed (and
> >they must in many low-level systems programs), the touted type-safe, r=
obust
> >Ada system is no longer=85 but now in the same field as many other lan=
guages.
Yes, Ada has dangerous features; so does C, C++, and any other
real-world language. The point is that proper system design isolates use
of these dangerous features to small sections of code, and hides them
behind well-defined abstractions. Then the full strong typing of Ada
protects the rest of the system. C and C++ cannot do this.
To paraphrase Robert Dewar, the moral of this story is "don't presume to
critique a language you have not used extensively". In this case, the
critiquer appears to not have used Ada at all!
-- =
- Stephe
next prev parent reply other threads:[~1997-06-17 0:00 UTC|newest]
Thread overview: 134+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-05-28 0:00 ada and robots John Bohn
1997-05-29 0:00 ` Michael F Brenner
1997-05-29 0:00 ` Stephen Leake
1997-05-30 0:00 ` John Cook
1997-05-30 0:00 ` Tom Moran
1997-06-01 0:00 ` Dale Stanbrough
1997-06-02 0:00 ` John G. Volan
[not found] ` <5mv984$7kn@news.emi.com>
1997-06-03 0:00 ` Joe Gwinn
1997-06-04 0:00 ` Pat Rogers
1997-06-05 0:00 ` Joe Gwinn
1997-06-14 0:00 ` Robert Dewar
1997-06-16 0:00 ` Ken Garlington
1997-06-16 0:00 ` Robert Dewar
1997-06-17 0:00 ` Joe Gwinn
1997-06-28 0:00 ` Mike Stark
1997-07-03 0:00 ` Joe Gwinn
1997-06-04 0:00 ` John G. Volan
1997-06-05 0:00 ` Joe Gwinn
1997-06-14 0:00 ` Robert Dewar
1997-06-17 0:00 ` Joe Gwinn
1997-07-03 0:00 ` Shmuel (Seymour J.) Metz
[not found] ` <9706052229.AA29554@jaguar.nmc.ed.ray.com>
1997-06-06 0:00 ` John G. Volan
1997-06-07 0:00 ` RC
1997-06-09 0:00 ` Joe Gwinn
1997-06-05 0:00 ` Jon S Anthony
1997-06-05 0:00 ` Joe Gwinn
1997-06-14 0:00 ` Robert Dewar
1997-06-10 0:00 ` Robert Dewar
1997-06-10 0:00 ` Joe Gwinn
1997-06-11 0:00 ` Robert Dewar
1997-06-12 0:00 ` George Haddad
1997-06-16 0:00 ` Matthew S. Whiting
1997-06-17 0:00 ` Robert Dewar
1997-06-17 0:00 ` Robert A Duff
1997-06-18 0:00 ` Ken Garlington
1997-07-17 0:00 ` Shmuel (Seymour J.) Metz
1997-06-20 0:00 ` Adam Beneschan
1997-06-20 0:00 ` Robert Dewar
1997-06-17 0:00 ` Stephen Leake [this message]
1997-06-17 0:00 ` Robert A Duff
1997-06-20 0:00 ` jim granville
1997-06-21 0:00 ` Robert Dewar
1997-06-24 0:00 ` Re(dux): Ada for small machines (was Re: ada and robots) Ken Garlington
1997-06-29 0:00 ` Robert Dewar
1997-06-29 0:00 ` ada and robots Matthew Heaney
1997-07-03 0:00 ` Shmuel (Seymour J.) Metz
1997-07-13 0:00 ` Robert Dewar
1997-06-17 0:00 ` Jon S Anthony
1997-06-17 0:00 ` Matthew S. Whiting
1997-06-18 0:00 ` Robert A Duff
1997-06-18 0:00 ` Jon S Anthony
1997-06-22 0:00 ` John G. Volan
1997-06-18 0:00 ` Samuel Mize
1997-06-18 0:00 ` Matthew S. Whiting
1997-06-17 0:00 ` Samuel Mize
1997-06-18 0:00 ` Steve O'Neill
1997-06-19 0:00 ` Anonymous
1997-06-19 0:00 ` Kenneth W. Sodemann
1997-06-20 0:00 ` Stephen Leake
1997-06-20 0:00 ` Robert Dewar
1997-06-03 0:00 ` Martin A. Stembel
1997-06-04 0:00 ` RC
1997-06-04 0:00 ` John G. Volan
1997-06-04 0:00 ` Larry Kilgallen
1997-06-05 0:00 ` Jon S Anthony
1997-06-02 0:00 ` Nick Roberts
1997-06-04 0:00 ` Jan Galkowski
1997-06-05 0:00 ` Albert K. Lee
1997-06-06 0:00 ` dana
1997-06-07 0:00 ` John G. Volan
1997-06-10 0:00 ` dana
-- strict thread matches above, loose matches on Subject: below --
1997-06-05 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-05 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-09 0:00 ` Jerry Petrey
1997-06-10 0:00 ` Alan Brain
1997-06-10 0:00 ` Joe Gwinn
1997-06-11 0:00 ` Alan Brain
1997-06-11 0:00 ` Spam Hater
1997-06-11 0:00 ` Joe Gwinn
1997-06-11 0:00 ` Robert Dewar
1997-06-11 0:00 ` Samuel Mize
1997-06-13 0:00 ` Erik Magnuson
1997-06-17 0:00 ` Joe Gwinn
1997-06-18 0:00 ` Jon S Anthony
1997-06-19 0:00 ` Jonathan Guthrie
1997-06-20 0:00 ` Robert Dewar
1997-06-09 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-12 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-16 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-17 0:00 ` Joe Gwinn
1997-06-18 0:00 ` Jon S Anthony
1997-06-18 0:00 ` Brian Rogoff
1997-06-20 0:00 ` Robert Dewar
1997-06-23 0:00 ` Geert Bosch
1997-07-02 0:00 ` Robert Dewar
1997-06-23 0:00 ` Richard Kenner
1997-06-23 0:00 ` Robert Dewar
1997-06-25 0:00 ` Will Rose
1997-06-25 0:00 ` Jonathan Guthrie
1997-06-21 0:00 ` Nick Roberts
1997-06-16 0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-19 0:00 Jon S Anthony
1997-06-19 0:00 ` Brian Rogoff
1997-06-20 0:00 ` Jon S Anthony
1997-06-22 0:00 ` John G. Volan
1997-06-25 0:00 ` Richard A. O'Keefe
1997-06-23 0:00 ` Robert Dewar
1997-06-24 0:00 ` Brian Rogoff
1997-06-20 0:00 Ada " Huy Vo
1997-06-23 0:00 ` Jon S Anthony
1997-06-24 0:00 Huy Vo
1997-06-25 0:00 ` Jon S Anthony
1997-06-25 0:00 ` Alan Brain
1997-06-25 0:00 ` Dale Stanbrough
1997-06-25 0:00 ` Wes Groleau
1997-06-26 0:00 ` Ken Garlington
1997-07-01 0:00 ` Tom Moran
1997-06-26 0:00 Huy Vo
1997-06-27 0:00 ` nma123
1997-06-27 0:00 ` Wes Groleau
1997-06-27 0:00 ` Jon S Anthony
1997-06-27 0:00 ` Alan Brain
1997-06-27 0:00 ` Wes Groleau
1997-06-27 0:00 ` Stephen Leake
1997-06-27 0:00 ` Richard A. O'Keefe
[not found] <867541382.23405@dejanews.com>
1997-06-29 0:00 ` John Howard
1997-06-30 0:00 Huy Vo
1997-07-01 0:00 ` Alan Brain
1997-07-11 0:00 ` Will Rose
1997-07-02 0:00 ` Mattias Sj�sv�rd
1997-07-01 0:00 Huy Vo
1997-07-02 0:00 ` Wes Groleau
1997-07-02 0:00 Huy Vo
1997-07-04 0:00 ` Richard A. O'Keefe
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox