4 ms·
What’s the advantage of sticking to the new Fortran? Is it substantially compatible with legacy FORTRAN codebases and systems, despite having significant advanc
by danso 8y ago
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?
- wycy 8y agoThe 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.
- rootbear 8y agoThis. 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...
- sevensor 8y agoA 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.
- milancurcic 8y agoArray-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).
- danso 8y ago> 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.
- gus_massa 8y agoThe 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 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.
- clord 8y agoFortran 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.