Fortran
Formula Translation
- Pronunciation
- FOR-tran
In short
Fortran is the first widely used high-level language, created at IBM in 1957 for science and engineering and still used in high-performance computing.
What is Fortran?
Fortran was developed at IBM by a team led by John Backus and released in 1957. Its name comes from formula translation: scientists could write mathematical formulas almost as they appear on paper, and the compiler turned them into machine code that was nearly as fast as hand-written assembly, which convinced people that high-level languages were practical.
The language has evolved a long way since the punched-card era. Fortran 90 brought free-form source, modules and whole-array operations, and later standards, up to Fortran 2023, added object orientation, parallel programming with coarrays and interoperability with C. Compilers such as gfortran and Intel's ifx keep it fast on modern hardware.
Fortran remains strong in numerical work on supercomputers: weather forecasting, climate models, computational fluid dynamics, physics and chemistry simulations. Fundamental numerical libraries such as BLAS and LAPACK, used under the hood by NumPy, MATLAB and R, have their roots in Fortran.
A common misconception is that Fortran is only legacy code. New scientific code is still written in it, because its array syntax and compilers make number crunching both simple and fast. Its arrays are column-major and start at index 1 by default, which matters when sharing data with C or Python.
Key takeaways
- Fortran was created at IBM in 1957 for scientific computing.
- It was the first widely used high-level language.
- Modern standards add modules, array operations, OOP and parallelism.
- It still powers weather, climate and physics simulations on supercomputers.
- Core numerical libraries such as BLAS and LAPACK come from Fortran.
Example
program waves
implicit none
integer, parameter :: n = 1000
real :: t(n), y(n)
integer :: i
t = [(real(i) * 0.01, i = 1, n)] ! fill an array
y = sin(t) * exp(-t / 3.0) ! operate on whole arrays, no loop
print '(A, F8.4)', 'Maximum: ', maxval(y)
print '(A, F8.4)', 'Mean: ', sum(y) / n
end program wavesReaders ask
Is Fortran still used?
Yes, in scientific and engineering computing. Many weather, climate and physics codes that run on supercomputers are written in Fortran, and new projects in those fields still use it.
Why is Fortran fast?
Its design makes it easy for compilers to optimize numerical loops and arrays, for example because it restricts how arrays may overlap in memory, and decades of compiler work have focused on exactly that kind of code.
What is the difference between FORTRAN and Fortran?
FORTRAN in capitals refers to the older versions, up to FORTRAN 77. Since Fortran 90 the name is written with only a capital F.
See also
- COBOLProgramming Languages, p. 7COBOL (Common Business-Oriented Language) is a language from 1959 for business data processing that still runs critical banking and government systems.
- CProgramming Languages, p. 3C is a compiled, low-level programming language that gives direct control over memory and is used to build operating systems, drivers, and embedded software.
- CompilerProgramming Fundamentals, p. 11A compiler is a program that translates source code written in a programming language into a lower-level form, such as machine code, that a computer can run.
- MATLABProgramming Languages, p. 20MATLAB is a matrix-based language and environment from MathWorks for numerical computing, used by engineers and scientists for data analysis and simulation.
- JuliaProgramming Languages, p. 16Julia is a high-level, dynamically typed language for scientific and numerical computing, designed to be as easy to write as Python and as fast as C.
- ParallelismProgramming Fundamentals, p. 42Parallelism is running several computations at literally the same time, on multiple CPU cores, GPUs or machines, so a large job finishes faster.
Spotted a mistake or something missing on this page?Suggest an edit