Re: ADA Popularity Discussion Request
From: Marin David Condic (nobody_at_noplace.com)
Date: Tue, 17 Aug 2004 10:58:01 GMT
Keith H Duggar wrote:
> If I may explain. I'm a proficient C++ coder and have been
> using it for scientific research coding for eight years. And
> I have experience with various other languages including C
> and Fortran.
I think you will find that Ada is a really wonderful language for
scientific programming. It has excellent support for mathematical
programming. (Look at the attributes for floating point numbers, for
example.) The only area I could think of it being weak in that regard is
perhaps having a plethora of mathematical libraries already in
existence. They do exist, but probably not in the number they do in
Fortran and to my disappointment, there are not a large number of math
libraries (beyond log and trig stuff) that are either part of the
standard or so ingrained that they might as well be part of the
standard. Still, with all the numeric types, standard attributes and
other features, if you want mathematical precision, Ada can give it to you.
> "Ada was an experiment that failed. It was specified in such a way
> that it's hard to get adequate performance. So a critical mass of
> users and vendors never materialized. Now we see people devoting more
> energy to making C/C++ safer for programming large systems."
"Failed" may be a bit of a relative term. I don't think it achieved its
stated goals, but it is still used in a variety of places for its
inherent advantages. It is certainly not as big a language as I think it
ought to be given its merits and the ammount of money thrown at it.
As for inherent inefficiency, this is largely a myth. Part of the
problem was that 'Back In The Day..." Ada had a lot of new concepts that
compiler writers didn't thoroughly understand. It also had lots of
implied runtime checking going on that added overhead to executable
code. The thing is that fundamentally, all of its structures *can* be
implemented efficiently and these days, they typically are. Runtime
checks *can* be turned off when you want efficiency and, for the small
number of applications where it makes a difference, they typically are
So the efficiency thing kind of came about because of bad initial
implementations and was fueled by people looking for excuses not to use
the language. Now, this is not true, but its hard to overcome the bad
reputation. If you want proof by demonstration, get the free Gnat
compiler and do some benchmarking with it. Its also a C compiler. Write
some example code typical of what you do and clock it. Chances are, *if*
you learn to use the compiler effectively (setting the optimization
switches, turning off checks, etc.) you'll find it is competitive with
equivalent C code.
> Can any of you help me understand the details behind what he
> stated? Was it difficult to write compilers that gave good
> performance? Was the language specification too complex or
> difficult to implement?
Back in 1983, Ada rather exceeded the capacity of existing computer
hardware and strained the limits of compiler technology. Sooner or
later, both caught up and these days, efficiency is hardly a concern.
> Or are there simply missing features that preclude some
> efficient coding idioms (does Ada have pointers?). I'm
> very ignorant when it comes to Ada so please forgive these
> newbie questions.
Naturally, Ada has pointers. They are called "access types". Be aware
that usually when a C/C++ programmer starts talking about pointers from
an efficiency standpoint, they mean as a mechanism for passing
parameters to subroutines. This is because C was developed at a really
primitive level. Compilers are perfectly capable of deciding that a data
structure is too big to pass on the stack and will generate a reference
automagically for you. No need to fuss with dereferencing pointer
parameters inside your subroutines, etc. Its all done behind the scenes.
*Trust* the compiler in that regard and learn to use it effectively.
Ada programs typically use pointers a *lot* less than do C/C++ programs
because they don't need them. However, when you want to build linked
data structures or other things where pointers are needed, Ada has them.
Just don't try to write C++ code in Ada syntax or you'll find it is
really tough to do.
-- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "All reformers, however strict their social conscience, live in houses just as big as they can pay for." --Logan Pearsall Smith ======================================================================