Why will the Fortran programming language be a scientific powerhouse? An observation by Michael Wirth, professor in the School of Computer Science at the University of Guelph

According to Michael Wirth, a professor at the University of Guelph’s School of Computer Science, people are often surprised to learn how widespread Fortran is in the real world. For example, many climate models were originally written and continue to be maintained in Fortran. Languages ​​like Julia are trying to dethrone it, but I think Julia would be a better language if it included an ISO standard,” Wirth wrote.

Fortran is a programming language designed in the 1950s for scientific computing. It continues to be widely used in scientific research for supercomputing. Unlike more advanced languages, the flow of individual operations in the machine remains relatively controllable in the language, which makes it possible to write relatively efficient codes in terms of computation. Fortran has changed a lot in recent years with the appearance of the Fortran 90 standard.

According to Michael Wirth, one of the reasons why Fortran still works is its longevity. It’s easier to build on something originally built in Fortran (which is backwards compatible), than to start from scratch. People always make it look easy, but many engineering projects fail because you don’t understand how the original software works,” says Wirth.

Fortran is also very good at math, and climate models are nothing more than data processing and math.

I don’t like it when people try to explain that “Python is better” because of some crazy idea that its syntax is better than Fortran. Sure, it’s shorter, but that’s purely for the benefit of the programmer, not the machine,” he explains. And who’s to say that explicit typing doesn’t add a certain level of clarity, which is extremely important in programs that perform calculations.

Features of Fortran

  • High performance computing: the Fortran language was designed from the ground up for intensive computing applications in science and engineering. Mature, proven compilers and libraries let you quickly write code that takes advantage of the power of your hardware;
  • Strong static typing : Fortran uses strong static typing, which allows the compiler to immediately detect many programming errors. It also allows to generate strong binary code;
  • Easy to learn and use : Fortran has a relatively small vocabulary and is surprisingly easy to learn and use. Writing most mathematical and arithmetic operations in large tables is natural, as on paper;
  • Multiparadigm : Fortran allows you to write code in the style that best matches the problem: imperative, procedural, matrix, object-oriented or functional;
  • Parallel : Fortran is an automatically parallel programming language using an intuitive array-like syntax to communicate data between processors. It is possible to execute almost the same code whether it is on a single processor, on a shared memory multicore system, on a distributed memory HPC system, or a cloud-based system. The concepts of co-arrays, teams, events and collective subroutines make it possible to use different parallel programming models adapted to the programmer’s problem.

Here are some characteristics that Wirth presented to justify that Fortran is a scientific powerhouse.

  • Performance: Fortran is fast, in some cases faster than C, and climate modeling, like most scientific computing, is about speed;
  • Parallelism: performance requires parallelism, and Fortran does it before other languages ​​even know what it is;
  • Reusability: backward compatibility means that existing libraries can be easily reused;
  • Arrays: Fortran treats arrays with due respect. It supports multidimensional arrays, slicing, shrinking, reshaping, and many optimizations for array-based calculations, such as vectorization;
  • Longevity: Climate and other models cannot be implemented in languages ​​that are not (i) backwards compatible and (ii) constantly changing. If you write code in Fortran today, it will probably still work 20 or 30 years from now;
  • Effort: Do you know how much effort it takes to rearrange a model? New languages ​​pose a problem;
  • MPI: The Message Passing Interface (MPI) is the gateway to high performance computing, and Fortran handles it well.

Fortran was designed for scientific computing. Of course Fortran is old, but so is Unix, and so is C. Just because languages ​​like Julia are newer doesn’t mean they’re better. Everyone thought C++ was some kind of coding savior, and look how it turned out. Sometimes people think that if something is written in a language like R, then it is pure R… but fail to understand that R itself is not pure R. R itself consists of code that consists of R, C, and Fortran, he graduated.

Source: Michael Wirt’s Bolg

And you?

Do you share Michael Wirt’s opinion about the Fortran language?

Have you ever used this language? What are its strengths, what are its weaknesses?

Compared to the Julia language, which do you prefer?

See also:

Version 1.6 of the Julia language is available, it reduces compiler latency and eliminates unnecessary recompilations

Go 1.16 is available and brings support for the 64-bit ARM architecture to macOS, as well as the inclusion of static files and file trees in the final executable

C++ vs Rust: A Practical Compilation and Speed ​​Test Comparison of Two Programming Languages, by Matthew Glazar, Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *