Looking At Fortran In 100 Seconds

Usually, when we are talking about old computers, we are thinking of BASIC interpreters. But [Fireship] reminds us that it was originally Fortran and promises to give you the essentials in 100 seconds. We didn’t think you could do much in that short amount of time, but we have to admit that they did a pretty good job.

Of course, it doesn’t hurt that we know Fortran — you probably aren’t going to be able to put it on your resume after watching this video. On the other hand, we were impressed with how much they did squeeze in. If you haven’t touched Fortran since the 1960s and 1970s, you should know that it has changed. Pointers, dynamic memory allocation, and even objects are all possible. It is still a very capable language and very adept at crunching large sets of numbers. Besides, there are many sophisticated algorithms you can borrow from decades of Fortran development.

If you decide you want to have a go, there is, of course, GNU Fortran. Honestly, as much time as we spent writing Fortran in years past, we don’t recommend it for new job prospects. But if you have some period hardware and want an authentic experience, it might just be the way to go. Or, just fire up a browser if you want to play.

Not everyone agrees, though, that Fortran is on the wane. There are efforts to bring it even more up to date. You can even use it for web development.

35 thoughts on “Looking At Fortran In 100 Seconds

        1. In the early 2000s, I had to support Microfocus COBOL for a low-end educational ERP system which was a mishmash of COBOL snd Bourne Shell programs back-ended by an Oracle database with stored procedures. It seemed very old-school even then.

          I have also worked for a business-to-business transaction processing company who handled out-sourcing for Fortune 100 clients, and there was not one speck of COBOL or Oracle. I didn’t miss having COBOL around.

    1. Nick, I don’t know you, don’t know how old you are, but don’t forget Fortran took man to the moon, made the atom bomb and many other things you and me use today. Cheers

      1. There were NO digital electronic computers available to the Manhattan Project. The first digital electronic computer was being created contemporaneously at Bletchly Park.

  1. The first program I ever wrote was Fortran using punch cards. I took that as an elective course in college. That soured me on coding because it was so tedious, time consuming and no fun debugging by trying to figure out errors on green-bar print outs. I didn’t write another program after I graduated until I was introduced to interactive programing in BASIC on Wang 2200. The light went off and I changed gears from chemistry to IT and never looked back.

  2. I learned a bit of Fortran in the 1970’s. Back then, you did a correspondence course and had to write programs without access to a computer. It was bloody hard and i have never used Fortran in practice. Same for Algol

  3. I learned Fortran 77 in college as part of my CS degree. Luckily the seniors were the last to use punched cards … Missed the era by a whisker… Yesss. The next time I encountered Fortran was working with scientists doing plasma and material research which I had to setup a Linux box with Intel Fortran compiler at the time. Helped them keep their Fortran programs running too. Where I work now, the Energy Management System vendor was rewriting their code in C++ from Fortran originally, and this year we finally upgrade to the version that is Fortran free. I believe this is the last time I probably will run into Fortran in my professional life before retirement. Once in awhile I dabble with Fortran/Cobol at home for fun, but now most work at home and work is C/C++, Free Pascal (Lazarus), and Python. Dabbling in C# at work though…. Of course I like to dive into assembly once in awhile which is fun too.

      1. I worked for the US Gov’t in the late 1970s, and Ada was supposed to the future Holy Grail unifier of disparate platforms. It was a nascent concept when I was there, so I never had to endure an attempted transition, and I have no personal knowledge of how the attempt went.

  4. I took “ForTran IV with WatFor and WatFiv” in 1972. The “Wat”s (for Waterloo Ontario, CA) were required precompilers that would kick out errant “jobs” (e.g. infinite loops) in the school’s IBM360 mainframe (actually, I was at UMKC in Kansas City, MO and the jobs were remoted to MU in Columbia, MO), which caused another level of delay (I think they used “fast” 1200bps modems), critical if you were in a “hurry”. I never got angry back then over the fact that the instructor did not tell us that a card sorter existed that we could use (I think you could specify the columns to use as line numbers since not all cards were for ForTran). I found out when after tripping and spilling my “job” all over the floor at 2 AM, I was desperately sorting my cards and one of the computer room techs said: “just use the sorter”, to which I replied “the WHAT?”. That would also have come in handy in writing programs earlier since often ran out of line number “space” even though I followed the “golden rule” to use line numbers 10 counts apart. There were no “CRT terminals” for editing (where I was) as everything was done on punch terminals that resembled teletypes.

    NO, I’M NOT GOING TO SAY, “THE COOD OLD DAYS” because it totally sucked. I write everything in pencil since I’m so prone to mistakes, and those punch terminals are a royal pain!

    1. I am old enough to have used IBM Fortran as well as WatFor and WatFiv on system 370. My recollection was the Waterloo compiler was leaner than BM’s, and input card decks seemed not to need as much JCL wrapping. The Waterloo error messages were also pretty much human-readable, such as “Missing comma in format specification.” IBM liked more abstruse messages such as, “Error IEN301 has occurred.” I’m paraphrasing, not sure of the number after ~50 years. I recall going to the suite of IBM books to look up Error IEN301, and the explanation was rather terse, like, “Condition IEN301 has been found.” Thank you.

  5. Add another gray beard to the lore of FORTRAN IV. Took my first FORTRAN class in 1975 at Texas A&M and of course in that era we used punchcards on the IBM 029 machines in a room off the main library and in the basement of some long-forgotten building. I continued to use FORTRAN on DOD related work through the early 90s. Interspersed in there was graduate work and contract work using the plethora of languages common at the time: Ada, Basic, C, Lisp, Modula 2, Pascal, Snobol and others on a host of hardware including the Amdahl, HP 1000, various PDPs/VAXen, PCs and embedded hardware. Now I practice medicine and only “play” with contemporary languages on personal projects.

  6. I took a “Fortran IV with WatFor and WatFiv” (“Wat” for University of Waterloo), a Fortran 66 (?) at UMKC back in 1972. Our computer room was busy since it was dominated by business majors from the (H & R) Block School of Business. I was in a nascent engineering course with some on-site engineering professors and others who commuted from MU (Columbia, MO) to UMKC (Kansas City) to teach nightly courses (all 3 hour courses were taught in one night). That curriculum required Fortran, but as I said it “belonged” to the Business School. But, ironically, the IBM360 used was located at the MU campus and interconnected by “(blazing) high speed” 1200bps modems on two dedicated lines so it could run full duplex. Job transit times were long, partly due to the queue wait times and Business School had priority, and the link’s “blinding” speed.

    We did get “special” engineering related assignments in class, but one thing that we were never taught in class was that there was as machine down in the computer room that could sort punched cards in the order specified by the “line number” columns entered in the machine.

    I found that out the “hard” way when at about 2AM, after just finishing my LaGrange program, I rushed to the desk to drop it off, tripped, and spilled the cards everywhere. They took while to pickup. Then I sat by the computer room desk trying to sort the cards when a guy at the desk said “just use the card sorter” and I said “WHAT?!” It wasn’t fast, since it was mechanical, but it was way faster than me and fun to watch. (My last submittal just DISAPPEARED)

  7. @Al Williams said: “Honestly, as much time as we spent writing Fortran in years past, we don’t recommend it for new job prospects. But if you have some period hardware and want an authentic experience, it might just be the way to go.”

    Honestly, I disagree. There’s still a lot of worth buried in Fortran. Look at the rich and very valuable software written in Fortran.[1][2] Fortran was originally developed by IBM in the 1950s. Fortran IV and/or Fortran 77 is a reasonable pivot-point for legacy compiler/code compatibility. Next perhaps might be ANSI Fortran. Regardless, be prepared for some manual source tweaking (it’s easy).

    Fortran’s strength stems from its reputation as THE legacy language for scientific, engineering, and statistical computing – for decades. Proof of this lives in the deep and powerful content contained in the still viable Fortran compatible International Mathematics and Statistics Libraries (IMSL) [3] and the Statistical Product and Service Solutions (SPSS) Libraries [4].

    Before you waste precious time reinventing the wheel, look at what has already been done in Fortran. More times than not you will be surprised with what you will find. Plus, as a bonus you will discover that Fortran is fairly easy to port to other languages, the syntax just makes sense. After all, love-it or hate-it BASIC was largely based on FORTRAN II.[1] However unlike BASIC, Fortran is not an interpreted/interactive language. Like C/C++ Fortran is compiler based.

    * References:

    1. Fortran:


    2. Libraries in Fortran (Extensive)


    3. International Mathematics and Statistics Library (IMSL)


    4. Statistical Product and Service Solutions (SPSS) Library


    1. In a way I agree with you, but you have to know what you are looking for is ‘there’ to use it… and then have the will to figure out how to use it, modify it, bring into your application, etc… I dealt a tiny bit of that with that in getting old Fortran code to run using the Intel Fortran compiler…. I did get the needed apps to run with some tweaks, and the scientists were happy, A lot of good software is simply lost/re-invented because of no knowledge of it’s existence elsewhere or not worth the trouble to convert/copy/use.

    2. heh, i disagree entirely with your thrust, of course…everything fortran does, newer languages do better. Backus invented the modern optimizing compiler and the core components and concepts haven’t changed much but in every detail (and details matter in languages!) fortran is, well, decades behind. it’s possible to write good software in fortran but for the most part people didn’t bother.

      i thought you came up with a really great frame to make my point: “Fortran’s strength stems from its reputation as THE legacy language for scientific, engineering, and statistical computing – for decades.”

      yeah, a bunch of non-programmers wrote mountains of unmaintainable and never-quite-understood fortran code. it’s true! :)

      a summer job when i was in college back in 1999 was to port some fortran code from DEC VAX/VMS to Linux using the (awful) Absoft fortran compiler. for whatever reason, no one at the cyclotron facility thought to tell the summer intern the purpose of the project. i waded through thousands of lines of code that implemented a bad commandline interface (the program had its own commandline, much like gnuplot). you know, the kind of string parsing and abstraction-dependent that fortran isn’t particularly great at, especially in the hands of non-programmers. and then there was a massive library of different kinds of I/O interfaces — tape, etc — that were specific to VMS. and since i didn’t know what its purpose was, i couldn’t prune away cruft.

      i got done with the project, and one of the physicists came and sat down and showed me how they use it, and i was floored: it was just a histogram program. it converted a 3-axis dataset to a 2-axis dataset by summing all of the values along one of the axes, and then it displayed it on the screen in an awful way. i struggled through a thousand lines of tape driver interface code for this one-afternoon project!

      the physicist was just as astonished, because the motivation for the port was to overcome a 32MB mmap() limit in VMS…the brand new Linux machine had the exact same limit. it only took me a few minutes to find the right spot to change the linux mmap() limit, but using mmap() in this way was totally gratuitous in the first place.

      the legacy scientific software is 99.999% garbage. there are a lot of people who still get real work done with this stuff but if you know another language and understand the underlying mathematical concept, you will absolutely save yourself a lot of trouble by simply not using fortran. summing data to make a histogram is not such an obscure task that you need to honor all the quirks of archaic software.

      1. @Greg A said: “…the legacy scientific software is 99.999% garbage.”

        C’mon Man… The best you can come up with is a sweeping statement dismissing without proof the vast corpus of the tried-and-true over decades Fortran IMSL and SPSS libraries? Sheesh.

        @Greg A said: “…everything fortran does, newer languages do better. Backus invented the modern optimizing compiler and the core components and concepts haven’t changed much but in every detail (and details matter in languages!) fortran is, well, decades behind.”

        Nonsense, Fortran is a language and every language has its own strengths and weaknesses. I claim Fortran and its easy to use syntax for scientific and engineering applications is more than proven and still viable. As for Fortran being outdated, nonsense-again. There are plenty of modern, efficient, free, free-open-source, and commercial Fortran compilers and compiler front-ends available today.[1][2][3]

        * References:

        1. Intel Fortran Compiler (Freeware)



        2. GNU GCC Fortran Front End (FOSS)




        3. More Fortran Compilers


  8. FORTRAN remains one of the best languages for scientific programming, due mainly to its native complex data type. You can accomplish the same thing with Ada and C++ and some operator overloading, but it doesn’t work out as well. But in return FORTRAN isn’t the right choice for web development, graphics and many other things. Forcing languages into a one size fits all hasn’t ever really worked out.

  9. I took my first FORTRAN class in 1962, using an IBM 1620, and used it in my financial analysis courses to analyze financial statements for common sizing, ratios, and other formulae over quarters and fiscal years. It was also useful in my nine statistical courses. Handy tool, better than endlessly punching keys on large business calculators (mostly Monroes). Aced the courses until graduating in 1965.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.