Celebrating 70 Years of Fortran

(fortran-lang.org)

94 points | by rbanffy 2 hours ago

21 comments

  • vegesm 0 minutes ago
    At some point I was quite interested in how the very first version of FORTRAN looked like, so I wrote a FizzBuzz [1] in it.

    It was a very bare-bones language, felt more like a high-level assembly macro language. One thing it did well was expressing formulas with the usual "mathematical" notations (+,-,*,/, parentheses to group operations, variables). I guess this was revolutionary at the time. But the control structures were very limited, everything was basically jumps and gotos. The IF was merely a syntactic sugar for conditional jumps. Of course, functions did not exist in the language.

    [1] https://mveg.es/posts/fizzbuzz-in-fortran-1/

  • whartung 1 hour ago
    FORTRAN was a very important language for me.

    Growing up on early micros, with BASIC, my father had Fortran for the TRS-80.

    I took a stab at learning it, but the documentation was reference for calling the compiler, not so much learning the language. And when I found a FORTRAN book, it was quite dated and talking about things like tapes and punches and what not.

    So, that effort stalled.

    But, my first quarter in college, I took a FORTRAN (77) class. FORTRAN taught on the schools CDC Cyber mainframe.

    This was quite a change from 8-bit PET BASIC.

    But, most importantly, it was exposure to much of the same concept that an 8-bit computer has, but from a different tact.

    This gave me more of a way to view things from a higher level, since I had to make them fit the two different views of how FORTRAN looked at things, how the Cyber presented things, and how BASIC and the PET were "same thing only different".

    It also gave me access to a multi-user system, and all of the interesting capabilities it offers.

    I remember when they put in their first lab of PCs, and how they started teaching folks Turbo Pascal on micro computers, and I just felt that the users were missing out on a bigger world. "Anyone" can access a PC or micro computer at home, but mainframe or multi user mini access, not so much. It's just a much bigger world out there, and we tend to baby duck what we first see.

    Different world today, never had to use FORTRAN professionally, but I am most grateful for the experience of learning it and its environment. Very powerful medium for broader learning.

    Also FORTRAN was the only notable computer thing I had "taught" to me (outside of my 20 minute introduction to BASIC by my high school teacher), pretty much everything else I self learned from books and such, even knowing the bulk of it before taking classes in school.

    • otterdude 1 hour ago
      Fortran while historically important doesn't really seem like a good choice today.

      I worked with a proprietary jet engine analysis software suite written in Fortran 77 and It felt very primitive, albeit fast.

      Today I feel like C is a much better choice for speed and readability.

      If you really need the fastest performance I dont think Fortran gives that much of an advantage writing assembly.

      • jleyank 56 minutes ago
        With vector machines, Fortran yielded (much) faster code because (a) there was a whole lot of work on preprocessors for "dusty deck" code and (b) the lack of pointers and their overlap let the compilers do their stuff. C code needed a lot of #pragma's to let it know that some pointers didn't overlap and so could be optimized.

        We found it best to to the front-end and I/O of the code in C and the compute in Fortran. Fastest calculations especially with those tailored libraries.

      • mohamedkoubaa 7 minutes ago
        Fortran invented array-based programming, which arguably numpy advanced and now Julia finally perfected
      • crassglassass 1 hour ago
        Aren't most people doing this kind of work these days engineers using matlab?
  • dranudin 57 minutes ago
    I wrote Fortran for my first job as a software developer in 2018 for simulation solvers. Still like the language! Modern fortran is very very fast and much nicer to use than C for linear algebra. So in my opinion for numerical calculations it remains the best language, even today. Happy Birthday!
  • FabHK 1 hour ago
    I wanted to learn Fortran in the 1990s and borrowed a Fortran book from the university library. On the first or second page it stated "To mark comments, just punch a letter 'C' into the first column of the punch card." I returned the book and never learned Fortran.

    Having said that, so many foundational libraries were implemented in Fortran (BLAS, LINPACK/EISPACK, LAPACK, MINPACK, FISHPACK, FFTPACK, etc.) - thanks for that.

    • PaulHoule 41 minutes ago
      Mainframe-era systems often used fixed-size or limited-size buffers and data structures, based on those 80-character punched cards, most addressing modes adding 12-bit immediate displacements to pointers held in registers [1] bytes and such.

      It is easy to laugh but C programmers have demonstrated that they can't handle variable-sized buffers on the stack, malloc(), free() and all that.

      Early versions of FORTRAN [2] didn't even have a stack, like you couldn't write recursive functions, the program would take parameters for array sizes when it boots and the memory layout would all be figured out at the beginning. When I was developing a display controller for persistence of vision controllers for the AVR-8 it drove me nuts how the C compiler kept moving the stack pointer around all the time for no real reason when an assembly program could move data to and from statically allocated structures. [3]

      FORTRAN and COBOL came out around the time Syntactic Structures did so of course there was not an established theory for how to parse grammars, no parser generators, etc. No Dragon Book, but the heroic techniques used to develop compilers in that age are legendary if not quite lost.

      I wrote some FORTRAN programs in high school on a VAX, in a comparative programming languages class in college, converted a lot of FORTRAN algorithms into statically allocated Java in grad school in 1990 and in my postdoc I wrote a generator that wrote JNI bindings for LAPACK.

      [1] ... e.g. the typical struct is < 4096 bytes

      [2] before the FORTRAN 90 standard though you could set the /RECURSIVE flag on DEC FORTRAN befor ethen

      [3] we were done such a disservice by all those "it's so elegant to compute Fibonacci in a better programming language than BASIC" articles in Creative Computing because recursion is one of those things, like C's memory management, that most programmers can't really handle.

  • hermitcrab 2 hours ago
    I started off programming in FORTRAN in my first job, 40 years ago. There was a lot of terrible stuff in FORTRAN from a software engineering point of view: COMMON blocks, GOTOs, ENTRY points (to enter a subroutine part way through!), but it was one of the first high level language and language designers had a lot to learn.
  • jmspring 56 minutes ago
    An ex got me "A Fortran Coloring Book" years ago while I was working with astronomers. I was still in grad school and it gave me an excuse to learn it.
  • ryan_glass 2 hours ago
    In the mid 90s I used Fortran to model a distillation column in a chemical engineering plant. Here I read that it is still the go to language for nuclear engineering. I am amazed but for some reason happy about this.
  • jandrewrogers 1 hour ago
    FORTRAN is also the origin of using 'i', 'j', 'k', etc as loop variables in code, since 'i' was the first variable name that could be used for that purpose. The original language design was constrained by very primitive computers.
    • tyromaniac 1 hour ago
      Is that really true, if so, what's your basis? Fourier used i for the same purpose, and it definitely became a pretty standard indexing variable long before the 1950s. Most early code written in FORTRAN was essentially just transcribing formulae and algorithms that already would use such variable names.
    • throw-the-towel 1 hour ago
      i has been the default variable for sum notation in mathematics long before FORTRAN. Here's an example dating from 1838: https://www.numdam.org/item/JMPA_1838_1_3__508_0.pdf
    • whartung 1 hour ago
      The reason 'i' was the first letter available was because by default identifiers starting with, I think, I-N were integers instead of float.

      When I first started, with BASIC, my variable of choice was T simply because it was easy to type NEXT T in the FOR loops (why not R? I dunno...T just stuck).

    • jibalt 56 minutes ago
      The original language design was constrained by primitive thinking and lack of experience. The nature of computers in 1957 had no bearing on such things as variable names starting with I-N being implicitly integers ... that followed existing mathematical practice.
      • jleyank 53 minutes ago
        "that followed existing mathematical practice". Not what I would call primitive thinking. It set out to handle math quickly and it succeeded. I/O wasn't its strength, and I'm sure the latest versions look like verbose C.
        • jibalt 50 minutes ago
          Weird strawman. Read what I wrote again, this time for comprehension. I won't comment further.
  • hotelsacher 2 hours ago
    Happy birthday! I think this has to be the oldest programming language still in use. 70 years is quite an eternity in the sphere of computing. Before Fortran, there was (almost?) nothing but assembler and plug board connectors.
  • insanetake 6 minutes ago
    "I don’t know what the scientific language of the year 2050 will look like, but I know it will be called Fortran."
  • waynecochran 24 minutes ago
    FORTRAN 77 was the language for the first programming language course I took. I absolutely hated computers and programming after that course. Later I took CS courses and used Pascal -- one day the concept of abstraction hit me as we were developing data structs in the 2nd semester and the light went on. That is when I first started to love programming. FORTRAN was thereafter referred to as the F language. Sorry to be a bummer, but I still recoil when I hear about that language.
  • richardantj 1 hour ago
    It's 30 years since I last used Fortran to pass my Civil & Structural Bachelor's and Masters. Loved the simplicity of it, modelling spring stiffness in concrete and steel piles hammers into the ground and tie rods being pulled out of their grout anchors. However, what blows my mind is that something I did on a 386/ 486 as a 3-6 month research degree is now modelled by AI and run on my desktop in minutes.
    • brcmthrowaway 1 hour ago
      Well, what happened with your degree? Do you use it?
  • RetroTechie 1 hour ago
    More precise:

    Many years of FORTRAN. Followed by many years of Fortran.

  • jibalt 2 hours ago
    I learned programming in FORTRAN II on an IBM 1620 in 1965.
  • WalterBright 53 minutes ago
    I abandoned FORTRAN for good when I discovered C.
  • BeetleB 1 hour ago
    Have people moved on from Fortran 77?

    It was frustrating that, 30 years after Fortran 77, professors were insisting in writing in that dialect. Thank God I escaped that hell.

    Edit: Since people don't understand my point - I'm well aware of the existence of newer Fortran standards. But in much of academia, the professors insisted on sticking with Fortran 77.

    • jibalt 52 minutes ago
      After Fortran 77 came Fortran 90, Fortran 95, Fortran 2003, Fortran 2008, Fortran 2018, and Fortran 2023.
      • BeetleB 29 minutes ago
        I'm well aware of it. And as late as 2007, I was forbidden from writing those dialects. Professors wanted everything in Fortran 77.
    • dranudin 53 minutes ago
      Yes. With Fortran 90 most of the real archaic stuff was already gone. And they keep publishing new standards.
    • jleyank 51 minutes ago
      There was a CS literature joke that I saw back in 1982. "Whatever language is used to program high-performance machines, it will be called Fortran.".
  • Frone125 2 hours ago
    It's crazy to think that any programming language is that old.
    • jibalt 1 hour ago
      I don't see why. LISP is just a year younger and COBOL is 2 years younger. And Algol, spawned a year after FORTRAN, is no longer used as such (although there is now GCC support for Algol 68) but spawned many "Algol-like" languages, including most of the languages used today ... and even modern Fortran can be considered "Algol-like", having evolved to include its block structure.

      FWIW, I started programming in 1965, in FORTRAN II.

    • tasty_freeze 2 hours ago
      As someone who has been programming for nearly 50 years of it, it seems less remarkable.
  • buddyholey 47 minutes ago
    I worked on BLAS. Amazing language and tremendous impact it's had over the decades.
  • hermitcrab 2 hours ago
    "A good FORTRAN programmer can write FORTRAN in any language"
  • shaohua 1 hour ago
    Thank you,Fortran!
  • jmclnx 2 hours ago
    My first language, I should try and mess with it again. It has been decades since I used it.
    • hermitcrab 2 hours ago
      I believe it has changed quite a lot, keeping its focus for scientific/engineering computing, but adapting more modern language constructs. I'm not sure how much of the archaic stuff (COMMON blocks, ENTRY points etc) is supported in the more recent standards for backward compatibility.
      • jleyank 50 minutes ago
        Aren't COMMON's implemented as static structures? Stuff that's accessible from multiple functions - except that Fortran requires explicit rather than implicit reference.
        • hermitcrab 42 minutes ago
          It is way of sharing variable values without using parameters. But it is ugly and easy to make errors, e.g. accidentally missing a variable out of the middle of the list in one function or subroutine means all the later variables have unexpected values.

          It is a log time since I did any FORTRAN. Maybe they improved it?