Fortran Goes Interactive

When you think of Fortran you probably think of punched cards and green bar paper. While it is true that Fortran isn’t the go-to language it used to be — pun unintentional — it still has a vibrant community of people who do serious number crunching. However, many members of that community have been seduced away by interactive tools that are also good at number crunching like MATLAB, Julian, and Python with special libraries. The LFortran project aims to create a Fortran environment with interactivity like Python, but retaining the speed that Fortran is known for.

The resulting tool is impressive. You can use it from Jupyter, can parse code targeting existing Fortran compilers, and supports Linux, Mac, and Windows. There is development to make the code fully interoperable with other languages like C or Python as well as take advantage of GPUs and other specialized hardware. They are also zeroing in on full Fortran 2018 support.

If you want to try it out, you could go to the Git repository. However, since it is compatible with Jupyter, you can open it online using Binder. The developers hope people won’t see it as just a way to run legacy code, but will introduce Fortran to a new generation of developers who will use it to do new things.

We’ve seen Fortran make a bit of a comeback lately. You can use it to serve Web pages, although that might not be the best use of its power. If you want to learn more about using Jupyter notebooks which can support many different languages, we covered that earlier this year.

8 thoughts on “Fortran Goes Interactive

  1. /cali surfer accent/
    Duder, are you serial?

    Did some Fortran in a time long ago, in a galaxy far away (was working for the DoD). And recently did some gcc Fortran to revive some old astronomical stuff for the niece. While I am not the most experience Fortran writer, and am probably too old to understand, but what is the broad use-case for an interpreted Fortran?

    Fortran is still a good tool (mostly because of the proven libs) to whale on train-loads of numeric stuff. And I get why ‘big data’ likes to use Python (where much of the processor-intensive stuff is oft done in linked C routines). And there is the f2py utility.

    1. Interpreted Fortran in a REPL is probably just good for introducing people to the language. The real meat of it will still be in fast matrix manipulation (or whatever it’s supposedly best at, but I think that’s where it edges out C sometimes?) but this is a handy bridge to there.

  2. I had to do some fortran programming a couple of years ago. I think the only thing it had going for it was speed. It’s amazing how easy it was to make a major error uncaught by the compiler.

  3. Good old Fortran! So much more logical and intuitive that the ghastly C++. Of course, it was written by physicists and not illiterate nerds, so no wonder it is so good.

  4. Fortran has left a deep mark on my heart, even today similar code using modern libraries on other languages(python) doesn’t beat it in terms of speed unless you run it in parallel but alas Fortran also supports parallel processing. I have since moved to python as a physicist but without my cuda cores running python code successful big data analysis just wouldn’t be possible

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.