From: Andrea Taverna on
On 4 Apr, 06:46, "Nasser M. Abbasi" <n...(a)12000.org> wrote:
> I was browsing the net for scientific software written in Ada, and came
> across this strange statement:
>
> http://farside.ph.utexas.edu/teaching/329/lectures/node7.html
>
> "Scientific programming languages
> What is the best high-level language to use for scientific programming?
> This, unfortunately, is a highly contentious question. Over the years,
> literally hundreds of high-level languages have been developed. However, few
> have stood the test of time. Many languages (e.g., Algol, Pascal, Haskell)
> can be dismissed as ephemeral computer science fads. Others (e.g., Cobol,
> Lisp, Ada) are too specialized to adapt for scientific use.
>
> ......
>
> The remaining options are FORTRAN 77 and C. I have chosen to use C "
>
> I find this strange, because I think Ada can be the best programming
> language for numerical work. So, I do not know why the author above thinks
> Ada is "too specialized to adapt for scientific use". Is there something in
> Ada which makes it hard to use for scientific programming?
>
> The main problem I see with Ada for scientific use is that it does not have
> as nearly as many packages and functions ready to use output of the box for
> this, other than that, the language itself I think is better than Fortran
> and C for scientific work.
>
> (the above quote is from a course on Computational Physics at University of
> Texas at Austin, may be I should write to the professor and ask him why he
> said that, but I am not sure I'll get an answer, my experience is that most
> professors do not answer email :)
>
> --Nasser

In my infinitely small experience with Ada as a CS student and self-
taught practitioner I have to say that's mostly "FUD".
There's a lot of pressure to make you use C or derivatives (C++, Java/
C#) or the language du jour, e.g. Python, because everyone believes it
must be one of the following ways: C's, hard, cryptic, fast, Java's,
quick, tedious, slow, or Python's, quicker, so-good-that-it-can't-be-
serious and slower. Other alternatives must be significantly worse
than one of these, no exceptions.
This is not the reason for which the languages above are used, but
it's the explanation given for not trying the alternatives.

<rant>
The only true reason for which Ada or other languages aren't used is,
as you said, the amount of available software directly usable in those
languages, which depends on the popularity of the language itself,
which, in turn, depends on the ease with which the language can be
implemented in popular architectures (x86 PC). This more or less dates
back to Unix and C being the ultimate computer viruses (cfr. "The Unix
Haters Handbook") ... </rant>
From: Jerry on
On Apr 3, 9:46 pm, "Nasser M. Abbasi" <n...(a)12000.org> wrote:
snip
> Is there something in
> Ada which makes it hard to use for  scientific  programming?
>
snip
--Nasser

No. I use Ada every day in my personal research and it is outstanding.
I can choose any language that I want and I chose Ada.

I have used other languages for research, mainly Pascal, Fortran--a
long time ago, commercial packages starting with the letter "M", Igor
Pro, SuperCollider, ChucK, and others. Some of these remain in my bag
of tricks and as most on this list will agree, you need knowledge of
several languages and you should pick the best for the job. For
everyday general technical computing, that, for me, is Ada.

There have been discussions on this list in the past about the
relative lack of technical libraries for Ada. I find that (despite
criticism from some quarters) that Numerical Recipes is excellent--it
gets the job done. (There is an Ada version that has been used as a
demonstration of the P2Ada language converter. I don't know of the
copyright issues of this, but I own rights to the Pascal version so
I'm covered, I suppose.) In any case, numerical code is usually pretty
simple (structurally) and you can easily do your own conversion from
Pascal or Fortran or C.

There are also Ada bindings to LAPACK and BLAS. Indeed, I believe that
that is the official implementation in GNAT for the new-to-Ada 2005
numerical functions. LAPACK and BLAS have been around for so long they
are probably bullet-proof by now.

There is also the GNU Scientific Library for which the Ada binding is
sparse, last time I checked. I think it would be an excellent project
to get this up to where it is generally useful.

Jerry
From: Nasser M. Abbasi on

"Jerry" <lanceboyle(a)qwest.net> wrote in message
news:e53558e5-5a83-4170-b8eb-4c8564c1788d(a)g10g2000yqh.googlegroups.com...

"No. I use Ada every day in my personal research and it is outstanding.
I can choose any language that I want and I chose Ada."

That is good to know.

It would be good if there was a web page which specializes in giving
information on Ada for scientific work (links, etc...). When searching the
web for Ada for scientific/numerical programming, there is very little
information. (few links, but very few examples that I found showing Ada for
numerical work for example).

But one thing I would guess is good in Ada for numerical work, is the
ability to define an array which can start from zero or from one. Many of
the formulas in textbooks assume zero index as the start of the array, but
when using a language with arrays that start at 1, then this was always a
source of errors (the one-off error) when it comes to implementation.

It does not help if the language array starts from 0, because if a formula
is define to start from 1, the same problem, but in reverse will occur.

I think Ada solves this nicely by allowing one to define the type to match
the problem. ofcourse one can say that they can just define a new class in
Java/C++/etc... to do this as well, but I think the Ada solution is better
as it is part of the language itself and is probably safer also.

This is only one thing out of 100's more things that I can see an advantage
of Ada for numerical work (which is full of arrays and matrices types).

If anyone knows of an advanced course in a computational
scientific/engineering field at a US university which uses Ada, I'd like to
know about it.

--Nasser


From: mockturtle on


On Apr 4, 6:46 am, "Nasser M. Abbasi" <n...(a)12000.org> wrote:
> I was browsing the net for scientific software written in Ada, and came
> across this strange statement:
>
> http://farside.ph.utexas.edu/teaching/329/lectures/node7.html
>
> "Scientific programming languages
> What is the best high-level language to use for scientific programming?
> This, unfortunately, is a highly contentious question. Over the years,
> literally hundreds of high-level languages have been developed. However, few
> have stood the test of time. Many languages (e.g., Algol, Pascal, Haskell)
> can be dismissed as ephemeral computer science fads. Others (e.g., Cobol,
> Lisp, Ada) are too specialized to adapt for scientific use.

Let me add just my 2.0e-2... I do research in communication and signal
processing
and this requires lots of programming (although I am not a
professional programmer).
To be honest, most of my "number crunching" stuff is done in Matlab,
since they usually
are "fast and dirty" tests of new algorithms and Matlab has lots of
numerical algorithms
ready off-the-shelf. However, for my long lived projects Ada is
without doubts
my first choice (that I impose to my students too... :-]). I must
confess also that my
third favorite language (for fast-and-dirty text-crunching scripts) is
something almost
opposite to Ada in term of philosophy: Ruby. ;-)

Back to the main topic, maybe the only defect of Ada in number
crunching is the lack
of some extensive numerical library (but it does not seem to me that
C, C++ or Java
are especially good on this...)
From: Dmitry A. Kazakov on
On Mon, 5 Apr 2010 02:09:53 -0700 (PDT), mockturtle wrote:

> Back to the main topic, maybe the only defect of Ada in number
> crunching is the lack
> of some extensive numerical library (but it does not seem to me that
> C, C++ or Java are especially good on this...)

There is a problem specific to Ada. A quality Ada library should deal with
all real types. (Other languages do not have this problem because they are
too primitive.) Technically this results in a bunch of generic packages
instantiated with some actual real type. Apart from being quite boring for
a user this approach has numerical problem. How would you specify and
provide the accuracy for all possible precisions, implicitly defined by the
formal parameter T? Say, the function f(X) should yield the result accurate
within T'Small or, maybe, within [f(X)'Pred, f(X)'Succ] etc. The accuracy
should depend on the precision. You also would certainly need some type
larger than T'Base in order to carry out intermediate calculations. How
would you get such a type in a generic unit?

Ada is an excellent language for number crunching by C's or FORTRAN's
standards. But this is not good enough by the standard of its own.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de