You are using an older browser version. Please use a supported version for the best MSN experience.

This old programming language is suddenly hot again. But its future is still far from certain

ZDNet logo ZDNet 5/5/2021 Liam Tung
a man sitting at a table using a laptop computer: Focused young developer coding late in office writing script shown on computer monitors, serious handsome coder programmer hacker programming developing software applications working alone at night © Getty Images/iStockphoto

Focused young developer coding late in office writing script shown on computer monitors, serious handsome coder programmer hacker programming developing software applications working alone at night

Fortran is the oldest commercial programming language, designed at IBM in the 1950s. And even though, for years, programmers have been predicting its demise, 64 years later it's still kicking, with users including top scientists from NASA and the Department of Energy using it on the world's most powerful supercomputers. 

It even recently – and very unexpectedly – popped up again in a ranking of the most popular programming languages, albeit in 20th place. This resurgence has been explained by the huge need for scientific number crunching; something that Fortran is very good at.

But few would argue that Fortran has an especially rosy future ahead right now, as scientists are flocking to newer languages such as Python or Julia.

SEE: Hiring Kit: Python developer (TechRepublic Premium)

Ondřej Certik, a scientist at the US Department of Energy's Los Alamos National Laboratory (LANL), is on a mission to resurrect Fortran via two key projects. LANL was key to the US's World War 2-era Manhattan Project to develop the first atomic bombs, and is also home to the Cray XC40-based Trinity, the world's 13th fastest supercomputer.

Many of Certik's projects are written largely in Fortran and he's trying to make Fortran more appealing to developers.

"When you mention Fortran, a lot of people will argue it is not dying. I would argue it is dying," Certik tells ZDNet. 

"At least people in my work are moving away from it. We still have millions of lines of code in it, so we will still have Fortran code 20 years from now, but for new projects, people don't use Fortran anymore."  

Certik hopes he can change that.

His first effort is the LFortran compiler, which will help to translate Fortran code into modern languages, including Python and Julia. The second is the fortran-lang website to give Fortran programmers what Python and Julia developers have – a space for a community to collaborate on improvements.   

"One way to think about Julia is that they took Python, and made it fast," he says. "With LFortran, we are trying to go the opposite route: take a fast language like Fortran and see how interactive you can make it."

Fortran itself is still actively developed through two main bodies: the US Fortran standards committee, J3, which is the primary influencer of standards set by the worldwide Fortran body, WG5. Intel, Nvidia, Arm, IBM, AMD, the DoE, NASA and others are represented on J3. 

"I think Fortran today is in a very difficult position," says Tom Clune, lead for the software integration team and the Global Modeling and Assimilation Office at NASA's Goddard Space Flight Center.

Clune, who is NASA's main representative on the J3 Fortran committee, says the language is snagged on the question of supporting new features that risk breaking old code.

"On the one hand, there are any number of newer languages that have features that appear to be desirable for problems that were traditionally the primary domain of Fortran," he tells ZDNet.

This puts pressure on Fortran to evolve new features in a short period of time.

"On the other hand, the current market has resulted in a shrinking number of modern Fortran compilers – a trend that is arguably now reversing – and decreasing budgets for Fortran compiler developers," he says.  

"When you combine these with the general desire to keep Fortran to be backward compatible, something is going to give." 

Fortran has undergone several major updates since 2000, including the F2003 and F2008 releases, and another in 2018. The next two updates are referred to as F202X and F202Y, but they're years away.

It's a tricky balancing act; match modern programming languages and risk breaking things or don't add new features – and risk losing users to newer languages. 

"We, the Fortran language committee, could push advanced features into the standard in a rush and end up with no actual implementations of those features," says Clune. 

"Alternatively, we more incrementally evolve the language, which runs the risk of losing a greater portion of the user base that cannot wait decades for desired capabilities. And there is absolutely no guarantee that there is a sweet spot in the middle," he admits. 

But he argues Fortran's survival is a benefit to the science community. The core parts of Fortran can generally be learned on-the-job and require a bit less sophistication than languages such as C++, he notes. And for scientists, switching languages introduces huge risk of introducing subtle changes to the analysis they are doing.

SEE: Programming languages: JavaScript has most developers but Rust is the fastest growing

Over at LANL, Certik feels the pressure to switch to a newer language than Fortran. Many of the organisation's 10,000 scientists want to switch languages, which makes adoption of LFortran harder. 

"There are some people who think we should just move away from Fortran," says Certik. "And there are some people who are seeing that there are physicists who are using Fortran, so they will like that. 

"But also, people who already use Fortran don't necessarily appreciate this Python- or Julia-like approach to it," he says. 

"Until everything really works, they don't necessarily see the vision. Some people say it's a dying language, but I think the potential is huge. When I talk to people who use Fortran, they tell me the number one thing they want is compilers that can run their code on modern hardware, efficiently – not just run, but take advantage of it."

And Clune argues that there are still new Fortran projects being developed. 

"There are certainly new projects being written in Fortran," says Clune, with small projects still turning into big ones: "Someone will add new features and before you know it there will be another big Fortran application out there," he says.  

However, Clune concedes it's becoming rarer.

"In particular, many science applications that would have once been born as small, 'throw away' Fortran applications are now started as small 'throw away' applications in Python," he says.

But Fortran still has benefits over new languages, he argues.

"Fortran has exceptionally good built-in support for numerical calculations and array manipulation, which is particularly important for scientists and engineers," says Clune. 

"Python and Java are generally perceived as being slower."

The future of Fortran?

Clune says the two "must have" features the committee is working towards include exception handling and generic programming – features available in other languages.       

However, execution handling has been dropped due to some major challenges on how to mesh exceptions with other Fortran features as well as some disagreements about specific details, according to Clune. And that next F202Y update might not arrive until the end of this decade – by which time Fortran will be 73 years old. 

"It is difficult to predict when F202Y will actually happen. My hope is that it will be no later than 2030, and that I will have the opportunity to exploit generic programming in Fortran before I retire. And, yes, nine years is an eternity in the modern software world," he says. 

Fortran has had an incredible run, and still has its admirers. And with decades of Fortran code still running efficiently around the world, it's not going to disappear any time soon. But unless it can catch up with its newer rivals, it may struggle to gain many new fans, or hold on to the ones it has now.

AdChoices
AdChoices

More from ZDNet

image beaconimage beaconimage beacon