News for hackers. Stuff that matters.
Re:Fortran is still a thing by danso on Tuesday November 27, 2018 @12:45PM (#18544582)
What’s the advantage of sticking to the new Fortran? Is it substantially compatible with legacy FORTRAN codebases and systems, despite having significant advances as a language?
Re:Fortran is still a thing by clord on Tuesday November 27, 2018 @02:27PM (#18545794)
Fortran has better aliasing rules than C. Most of the strangeness you have to do with restrict pointers in C are not a concern in high performance code. Because strides and dimensions and types are all laid out explicitly, the optimizer can really go to town. And with co-arrays the same syntax generalizes to multiple compute nodes.

I worked as lead on IBM’s ASTI component (part of xlf) 10 years ago, and kind of miss it sometimes.

Re:Fortran is still a thing by milancurcic on Tuesday November 27, 2018 @01:06PM (#18544850)
Array-based syntax for distributed memory parallel computing (look for coarrays) since Fortran 2008. OOP since Fortran 2003. Whole-array operations since Fortran 90. These are a few of my favorites.

New standards mark obsolescent or deprecate a few ancient features as they come out, however compilers maintain the support for these features. I'd say that the modern Fortran is almost completely backwards compatible with legacy FORTRAN, as far back as FORTRAN IV (predecessor to FORTRAN 77).

Re:Fortran is still a thing by danso on Tuesday November 27, 2018 @01:16PM (#18544967)
> I'd say that the modern Fortran is almost completely backwards compatible with legacy FORTRAN, as far back as FORTRAN IV (predecessor to FORTRAN 77).

That's very impressive! I assumed the compatibility difference was akin to what Perl 6 is to Perl 5- -- that is, not compatible at all.

Re:Fortran is still a thing by gus_massa on Tuesday November 27, 2018 @05:45PM (#18547577)
The rules for the lines formatting are different, but lucky you can write code in the "intersection format" that can be read by both http://fortranwiki.org/fortran/show/Continuation+lines

If useful if your coworkers are stuck to a old semi unknown machine and want to mix the new code with the old code and run it there too.

Re:Fortran is still a thing by wycy on Tuesday November 27, 2018 @12:56PM (#18544733)
The rationale was based primarily on 2 factors:

(1) Compatibility with legacy FORTRAN. Although it's not difficult to work with legacy FORTRAN via C, it's seamless to pass data around between legacy FORTRAN and Modern Fortran.

(2) The mathematical and array syntax. It's tough to beat Fortran's mathematical notation and easy use of multidimensional arrays.

Re:Fortran is still a thing by rootbear on Tuesday November 27, 2018 @01:10PM (#18544892)
This. As someone who once did a lot of computer graphics programming in C (not C++), I would have killed for proper arrays. Modern C, with variable length arrays, helps, but still...
Re:Fortran is still a thing by sevensor on Tuesday November 27, 2018 @07:01PM (#18548059)
A long time ago, at a university far, far away, I worked with SGI's gl library, which had FORTRAN bindings. In retrospect, that seems like a very smart idea. At the time, we stuck with the C bindings.