Exciting recent developments for Fortran coders

Expert Network member Sam Harrison describes some exciting recent developments for Fortran coders

At the end of last year, a new Twitter channel @FortranTip was launched, with the goal of sharing bite-sized tips on Fortran coding best practices, similar to the @SciPyTip channel does for scientific Python tips.

Example tweet from the FortranTip channel

The FortranTip channel is the latest in a host of exciting developments to come out of the Fortran Lang community. Fortran Lang was set up in 2019 and has rapidly developed into an open-source community of enthusiastic Fortranners, whose goal is to modernise software and tooling around the Fortran language. The theme is to erase Fortran’s outdated reputation and to demonstrate the advantages of using Fortran for modern computational workflows, from simple scripting in Jupyter Notebooks to full-scale numerical modelling.

Fortran Lang’s work focuses on areas of weakness that in recent years have made other languages, like Python, R, MATLAB and Julia, increasingly the go-to languages for scientific coding. This includes package management, feature-packed standard libraries, good documentation and the ability to use the language in “virtual labs” like Jupyter Notebooks. The Fortran Lang community is currently working on exciting projects such as:

  • Fortran Package Manager (fpm): a package manager and build system for Fortran. Its key goal is to improve the user experience of Fortran programmers. It does so by making it easier to build your Fortran program or library, run the executables, tests, and examples, and distribute it as a dependency to other Fortran projects. Fpm aims to nurture and grow an ecosystem of applications and libraries, in a similar vein to package systems like Conda and Pip.
  • Stdlib: The Fortran Standard Library project aims to bring a rich, featureful library of common programming tasks to Fortran, including utilities (files, strings, unit testing, logging, …), algorithms (searching, sorting, merging, …) and mathematics (a la SciPy – linear algebra, fast Fourier transforms, random numbers, ODEs, optimization…).
  • LFortran: A new interactive Fortran compiler, which can execute user’s code interactively to allow exploratory work (much like Python, MATLAB or Julia) as well as compile to binaries with the goal to run user’s code on modern architectures such as multi-core CPUs and GPUs.
  • Better resources to learn Fortran and a friendly forum for discussing anything related to Fortran.

The Fortran Lang discourse forum

The community has written a paper detailing the progress to date and outlining next steps for the community. The Fortran Lang website regularly publishes progress reports, and the latest 2021 in review article is a good detailed overview of what has gone on over the past year. So, next time someone tells you that Fortran is outdated, old school or stuck in the last millennium, point them towards Fortran Lang!

Fortran Lang publication detailing progress and next steps towards modern Fortran tooling and a thriving developer community

Next steps and getting involved

The aforementioned projects are rapidly developing, and the next steps and goals for 2022 largely involve continuing their development, with a focus on creating good documentation and tutorials to demonstrate their use, as well as expanding the community to new users and contributors.

If you are interested, there are numerous ways to get involved, from writing docs, to code reviews, right through to technical development of the various libraries. Take a look at this page and get stuck in wherever you feel most comfortable.

1 comment

Comments are closed.