Quote Originally Posted by MutantJohn View Post
I've heard this before, definitely.

Which is funny too because I've implementing some basic matrix routines myself and I've really been enjoying the C++ approach where I create a Matrix class. Using things like operator and function overloading making working with it very enjoyable. Plus, I can template it and things like enable_if checks and all this jazz.
This is why anyone who does a lot of work with math + any dimension arrays would like Fortran, because it's already done for you. Math operators already work out of the box with arrays. And you can't beat the array subscripting either. It's basically the ease of use of MATLAB but with a compiled language.

Examples:

Code:
! array addition
x = x + dx

! calculate the L2norm of an array of residuals
res = SQRT(SUM(r**2))
! or if you use gfortran + GNU extensions
res = NORM2(r)

! using array subscripting to set up the edges of a grid; first line sets the whole array to zero
p = 0
p(1:k-n+1:n) = 500*EXP(-50*(1 + y**2))
p(n:k:n) = 100*(1-y) + 500*EXP(-50*y**2)
p(2:n-1) = 500*EXP(-50*(1-x(2:n-1))**2) + 100*x(2:n-1)
p(k-n+2:k-1) = 500*EXP(-50*((1-x(2:n-1))**2 + 1))
Concurrency is built-in to the language in several ways, with FORALL, DO CONCURRENT, and coarray Fortran, among other things.