The only thing I absolutely hated about Fortran for parsing data files is that, according to the standard, a text file has to end with what amounts to an empty line. Many Fortran environments break this rule intentionally, but occasionally you'll find one that follows the rules. It inevitably bites people who forget that their last line of data must be followed by a newline, or else the line may never get read.
[1]https://github.com/muellermichel/Hybrid-Fortran (I'm the maintainer.)
Good luck beating the performance of a Fortran optimizing compiler.
Thus a Fortran compiler doesn't have to do anything special to make sure it preserves order when storing and accessing from two different arrays. Therefore the compiler can be much more aggressive about unrolling loops and changing the order of operations.
By contrast, given a loop like
for( i=0; i<N; ++i ) {
y[i] = 2*x[i];
}
a C compiler has to assume that y[i] might be the same memory location as x[i+1], for example. Thus it has to ensure that the load into y[i] is complete before accessing x[i].This is one reason you see a lot of C code that does numerical work hand-unrolled, with explicit stores, like this:
for( i=0; i<N; i+=4 ) {
xi = x[i];
xip1 = x[i+1]; xip2 = x[i+2]; xip3 = x[i+3];
y[i] = 2*xi; ... y[i+3] = 2*xip3;
}
Now that C provides the "restrict" keyword, a smart C compiler can do many of the same optimization tricks that Fortran has had since day 1.There's a HUGE number of languages that don't allow aliasing in this way. I wasn't thinking about "how to improve C", I had APL, J, K, Q etc. in mind, as well as languages that implement mass array processing with similar semantics in terms of a more conventional syntax.
Personally, I think that idea is hard to justify these days, especially when, in my experience, finding 20-30% speed differences between optimizing Fortran compilers isn't all that hard.
When I was at uni (10 years ago) I worked with libraries written in FORTRAN 4. Those that used F77 were ported only because it was necessary for use with the HP-FORTRAN compiler. The only F90 code in the department was my own.
You could always look at ratfor if you need to do a lot of character based stuff.
Back in the day I even wrote billing systems and a device driver for PDP's using fortran.
[1] http://home.comcast.net/~urbanjost/CLONE/KRACKEN/krackenhelp...
Coming from a more traditional CS background, I always thought that Fortran was archaic until I actually had to learn it for some scientific computing. I found it awkward to use, but at the same time, it had array capabilities that I've never seen in any other language.