Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there such good C compilers that fortran is becoming a redundant language? [closed]

Tags:

c++

c

fortran

Just wondered, as I'd always considered Fortran's use to be in supercomputing. However, I often hear C compilers can make C as fast as Fortran, so is it's use limited?

Also, if this is true what are the fastest C compilers?

Thanks in advance.

like image 302
James Avatar asked Apr 04 '11 20:04

James


1 Answers

Argh! No, no it doesn't. And in related news, Fortran growing some OOP/polymorphic stuff doesn't obsolete C++, Erlang doesn't render Haskell superfluous, python hasn't killed bash scripting, PHP doesn't obviate the need for javascript, and mysteriously, nothing has killed off Java, etc, etc, etc. There are a bazillion programming languages out there for a reason -- there is a set of programmers that finds them good tools for specific jobs. You don't have to like them for that to be true.

C is, fundamentally, a systems programming language. It is wretchedly painful to write anything like computational science stuff in it. C++ is better because it's richer, but suffers critically from the fact that it doesn't have multdimensional arrays as a first-class type (no, it just doesn't, ok?), and all of technical computing relies critically on multidimensional arrays. The lack of a single standard multidimensional array package for C/C++ makes it very difficult to write optimized libraries for that language, and once you commit to one package you have to use their data structures throughout. Python suffers from the same problem, and will do so until Numpy becomes part of Python core.

Fortran, for all its flaws, is the only language out there designed specifically for scientific programming. It allows python- or matlab- like array operators and slicing, and that can a scientific programmers life easier. Even then, lots of scientific programers don't like fortran; they prefer the toolsets or libraries available in other languages. And that's ok.

And just to fend off your next question -- no, we don't have to all agree on editors, either.

like image 189
Jonathan Dursi Avatar answered Sep 28 '22 01:09

Jonathan Dursi