Fortran: why people still use it, 67 years later

October 14, 20245 min read

In the rapidly changing world of computer programming, a cutting-edge product can become obsolete in a few years. As the first widespread high-level programming language, you would expect Fortran to be an outdated relic used only by a few enthusiasts. In fact, it is one of the 10 most popular programming languages in the world today.

At 67 years old, Fortran would be retired if it were a programmer itself; it has outlived all its creators. Yet its language standard – the collection of documents that anyone implementing it must follow – received its latest major update in 2018, with minor edits being approved in 2023. Oriented towards fast numeric processing, Fortran’s user base consists primarily of data scientists, and they show no signs of abandoning it.

To understand Fortran’s lasting popularity, we must look at its long history. The first version of Fortran was released in 1957 by a team led by John Backus working at IBM. It ran on computers reading programs from punch cards – pieces of thick paper that stored data using patterns of punched holes. At the time, computers were primarily used for numerical processing. To do this, researchers wrote programs in assembly language, which was fast to run but unintuitive. Fortran programs had to be compiled (converted from Fortran to the assembly language of the computer running the program) before they could be executed, but they ran as fast as assembly language programs and allowed data scientists to ignore low-level details of their processors.

Fortran became successful almost immediately. IBM capitalized on this by releasing Fortran II a year later. This had many more features, including functions (units of code, with clearly defined inputs and outputs if needed, that can be executed multiple times), which helped programmers organize and debug their code more effectively.

However, the language soon faced a problem. Competing manufacturers created versions of Fortran with incompatible features aimed at different sections of the market. Programs now potentially needed changes to run on different machines: exactly the problem with machine code that Fortran’s creators were solving.

To maintain consistency, the ANSI (American National Standards Institute) developed a standard in 1966, known as American Standard Fortran, that mandated the behaviour of the language and outlined minimum requirements for vendors producing compilers for it. The standard removed most of the remaining machine-specific aspects of the language.

By then, a huge amount of code had been written in Fortran: although its syntax was seen as “old-fashioned” as early as 1968, it had such a large body of code that data scientists continued to use it even as other languages came into existence.

To adapt the language to more powerful processors and new programming techniques, the standard was updated in 1977, with stricter regulations on the compatibility of extensions to the language. In 1990, the ISO (International Organization for Standardization) took over the task of updating the standard from ANSI and produced its third version, labelled ISO 1539.

Fortran’s active adaptation to the modern computing scene guaranteed its continued existence. Recent versions of the standard specify ways the language can work together with C, giving programmers the opportunity to use features from both languages. In 1995, support for splitting program execution to multiple processors was added. Object-oriented programming was first officially supported in 2003, bringing the language up to par with modern requirements.

As the trailblazer for high-level programming languages, Fortran influenced features and conventions in practically every high-level programming language. However, some more frustrating features exist exclusively in early versions of Fortran. For example, programs had a highly constrained format, a holdover from the era when they were written on punch cards: the first 6 characters of each line had to be filled with a numeric label, so the compiler could find and jump to the line if it later needed to; lines were also limited to a maximum length of 72 characters. These constraints were only removed in the 1990 update to the Fortran standard. Additionally, there were arcane rules on variable typing: unless otherwise specified, variables with names beginning I, J, K, L, M, and N are integers, while all others are real numbers. This led to the convention of using the letters as iteration variables in other languages.

Regardless, large organizations, concerned with costs and backwards compatibility, did not switch away. Outdated syntax was unimportant: it was cheaper not to rewrite textbooks or retrain employees to use a new language when Fortran could match their capabilities. The standardization of Fortran by ANSI, and later ISO, also contributed to the language’s longevity by assuring these organizations of the consistency of the language between vendors. By continuously improving its core identity – a fast, platform-independent language well-suited to data processing – Fortran has managed to stay relevant to the community that relies on it.