Pages

Tuesday, April 21, 2009

To Be Fair To Fortran

Okay, here is, in my opinion, why FORTRAN deserves to not be executed:
It is easier to write fast numerical programs in FORTRAN than in any other language.
To write fast codes in C++ you have to do one of two things:
  1. Use only the low level C objects, in which case you are in many respects no better off than FORTRAN since you are just trading one proceedural language for another. (Which doesn't have bound checking or other safety features FORTRAN has).
  2. If you use the real power of C++: classes and templates for well done modular and generic programming, you will have to be a slight programming expert. It takes a lot to properly learn how to use classes and templates and even more how to use them in a way to achieve the speed of FORTRAN. It can happen, but it does take a fair amount of learning.
For me the question is: Are we better off using a language which does not require a lot of programming training to write fast codes at the cost of what I described in my last post, or are we better off using a language which will take years to really master but in the end will produce codes just as fast without the headaches I described before?

As you know I tend to think numerical programmers need to be CS experts. It think it is better for the computing community for the reasons I already described. But maybe there is room for a language where you can write fast codes immediately without becoming a CS expert first.

1 comment:

  1. I agree with the CS experts bit, although I am an aspiring computational astrophysicist and nowhere close to a CS expert yet. Part of the problem, in my mind, is that - at CU, Ohio State, and BYU at least - there is so little collaboration between the computer scientists and the physicists. Even on a graduate student level, I have tried to take CS classes on several occasions, only to find out the class was going to teach to a commercial style of programming rather than a scientific style. I could care less about gui's and high-level constructs. All I care about is I/O, communication, and mathematical operations like FFT's and matrix solvers.

    It would be very helpful to have classes in the CS department for numerical scientists, but that (a) is of no interest to the CS department (why teach other departments grad students?) and (b) requires cross-department (and at CU cross-college) collaboration, which is like getting 5 of preschoolers to share the same coloring book. So I end up learning from other scientists and the occasional NSF-funded supercomputing workshop.

    ReplyDelete

To add a link to text:
<a href="URL">Text</a>