1. 25
  1. 6

    The learn section is one of the better quick-starts with Fortran that I’ve seen. it includes common gottchas for programmers coming from more modern languages, which I appreciate. I have to read Fortran on from time to time in my work and picked it up by scrounging off the group websites of other scientists. If anyone has an authoritative reference they like, please let me know.

    1. 3

      Thanks for the link. A slight shame to see implicit is frowned upon these days.

      That’s the origin of “God is real. Unless declared integer.” hacker one-liner. (By default fortran types letters based on their first letter. So likely indicies (i, j, k, etc) are integer.)

      1. 2

        implicit is frowned upon these days.

        IMPLICIT NONE was practically the first thing I was taught about the language (as a physics undergrad, concerning F77).

        1. 1

          Where I was working, all the f77 code I read had an implicit line to use double precision instead of single for the reals. Perhaps a codebase/location thing.

        2. 1

          So God is real, but Jesus is not?

          1. 2

            Nah, Jesus just defaults to the largest value. Then, as your workload increases, He might use all of your available memory as He handles it. His followers say He can also look at the records, spot those servers that can no longer serve people, and bring them back to life by merely calling their names. He also described all of it in a widely-published book possibly to prevent patent trolling against those using these methods.

            Glory be to the Saint Reliability Engineer that can do all these things other SRE’s cannot. :)

        3. 3

          There are some tutorials here which you might find useful. The latest versions are quite “modern” too, including things like OO support (since 2003) - the latest revision was in 2018.

        4. 3

          I once knew a physics professor who said something like “I don’t know what the programming language of the future will look like, whether it will have objects or anything else fancy like that. I do know that it will be called FORTRAN.”

          1. 2

            I’ve heard a lot — and this is reiterated on the website — that fortran is supposedly quite fast. Why is that the case?

            1. 9

              Among the reasons: no pointer aliasing by default, intrinsic support for parallel array operations (do concurrent, forall, where loops; array ranges), easy access to OpenMP.

              1. 5

                Fortran does have some attributes that can make it fast (like no pointer aliasing) but generally what people are talking about is BLAS which was originally a library but now is more like an interface with many implementations and has several very fast implementations with hardware level optimisations like SIMD and even GPU. BLAS is the gold standard for performant linear algebra.

                1. 1

                  It’s 63 years old. That’s a lot of room for optimization work.

                  1. 1

                    Are you saying that my dad must be very optimised then? He sure needs a lot of medication to keep him going.

                    1. 3

                      Programming languages aren’t (directly) driven by biological processes. They don’t start failing/dying just because they are old.

                2. 2

                  But…. does it have staying power? If I become a Fortran programmer, will I be able to find work in 10 years time?

                  I kid.

                  I’m pretty sure Fortran is the oldest extant programming language (just a smidge older than Lisp, Algol or Cobol). And I hope that this helps make it more accessible to newer folks and helps the Fortran community(!?) take advantage of other improvements that other languages/paradigms have developed.

                  1. 4

                    If I become a Fortran programmer, will I be able to find work in 10 years time?

                    Honestly? Yes. Even today, it still widespread use in the industry, particularly in numeric computing. Although I hope you’ll be content with maintaining legacy code.

                    I’m pretty sure Fortran is the oldest extant programming language (just a smidge older than Lisp, Algol or Cobol).

                    Fun fact: A predecessor of Lisp was an extension of Fortran (called FLPL). The other predecessor was IPL. Similarly, a predecessor of Cobol was Comtran, again, a Fortran extension. In addition, Algol was explicitly designed with a goal of covering shortcomings of Fortran in mind. I think it’d be an understatement to say Fortran was extremely influential. :-)

                    And I hope that this helps make it more accessible to newer folks and helps the Fortran community(!?) take advantage of other improvements that other languages/paradigms have developed.

                    That’s exactly what happened. Fortran (as a language) evolved a lot, constantly drawing new features from existing programming languages. Honestly, Fortran IV doesn’t even resemble Fortran 95. I’d say Lisp is the only other language that evolved this much but, unlike Fortran, it doesn’t have a single canonical standard.

                    1. 2

                      Halfway through your comment I was intending to link this, but it’s yours! It’s a great article.

                      1. 1

                        Thank you!

                  2. 1

                    What are the use cases for fortran? What would be the things it is/could best used for?

                    1. 2

                      Just search for “scientific” and “HPC” computing. It’s used in a lot of that. It helps that it’s a language that’s easy to optimize and has lots of optimizations over time for these things.