[Tutor] Hi

Alan Gauld alan.gauld at btinternet.com
Sat Apr 11 20:00:23 CEST 2015


On 11/04/15 13:32, Vick wrote:

> "The vast majority of numerical codes in science, including positional
> astronomy, are written in Fortran and C/C++.

True, because the vast majorioty of "scientific codes" (ie libraries) 
were written many years ago and are still maintained in the languages 
used back then. Mainly that was Fortran for science.

The vast majpority of *new* scientific code being written is not in 
Fortran (and not much in C either). In fact I don't know of any local 
university that still teaches Fortran as part of their normal
science or math syllabus.

Most new scientific work is done in Mathematica or similar high
level language and then translated when needed into a lower
level language like C or increasingly Java. (And if its
statistics often into R.)

> If you wish to use these codes in minority and less efficient
 > languages such as Python and VBA,

Minority - False. There are certainly more VBA programmers
than Fortan ones. And probably as many as there are C/C++
Python is only a little way behind Fortan if at all.
But if we limit ourselves to the scientific community
then its closer to being true.

>  learning to translatethis code into those languages
 > is a skill you will have to acquire."

Completely false. Almost all modern scripting languages
have mechanisms to call C libraries easily. (And high
quality  Fortran to C translators exist.)

Only if you need to write very high performance routines
that do not already exist - ie you are a research
scientist or mathematician - do you need to learn C
or Fortran. And even then its unlikely to be your
first choice.

> The "codes" in question are referring to a query I posed to him regarding
> the GUST86 theory on the computational position of Uranus' natural
> satellites authored by Laskar and Jacobson in 1987. The "code" is readily
> downloadable in Fortran at the IMCCE ftp site.

Have you investigated the SciPy libraries, and especially
the SciKit collection of specialist libraries. There
are several astro libraries in there.
Most are written in C but wrapped for use from Python.

> But his statement is insinuating that Python is inferior to Fortran as a
> mathematical tool

No, he quite correctly states that Python is less efficient
than C or Fortran for numerical analysis. That is true of
mainstream, Python. There are various projects attempting
to address that shortfall. But there are many dimensions
to the "goodness" of a programming language and "efficiency"
(ie runtime speed)  is only one of them. And on modern
computing hardware it is rarely the most important one.
Others include development speed (programming efficiency),
portability, reliability, connectivity, abstraction capability,
readability/maintainability, tool support etc.

To say any language is "inferior" to another needs to
be qualified by the dimension(s) being measured.
I see Steven has just posted a similar mail that goes
into the comparisons in more detail. So I'll stop
here :-)

> and that all of the scientific community prefers to use
> Fortran.

That depends who you talk to. I know many scientists who
swear by Mathematica and Matlab and don't use anything else.

> My question is simple: Is he right or wrong?

The answer is less simple: it depends...

Finally, for a more light-hearted take on the topic, see:

http://www.ee.ryerson.ca/~elf/hack/realmen.html

For maximum offence substitute Python for Pascal ;-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list