Encyclopedia > Fortran

  Article Content

Fortran

Fortran (also FORTRAN) is a programming language originally developed in the 1950s and still in use today. The name is short for "Formula Translation". Early versions of the language were known as FORTRAN, but the capitalization has been dropped in newer revisions beginning with Fortran 90. The official language standards now refer to the language as "Fortran".

Fortran is mainly used for scientific computing[?] and numerical analysis. Although originally a procedural language, recent versions of Fortran have included some features to support object-oriented programming.

The first FORTRAN compiler was developed for the IBM 704 in 1954-57 by an IBM team led by John W. Backus. This was an optimizing compiler, because the authors reasoned that no one would use the language if its performance was not comparable to assembly language.

The language was widely adopted by scientists for writing numerically intensive programs, which encouraged compiler writers to produce compilers that generate faster code. There are many vendors of high performance Fortran compilers today. Many advances in the theory and design of compilers were motivated by the need to generate good code for Fortran programs.

Several revisions of the language have appeared, including the well-known FORTRAN IV (also known as FORTRAN 66), FORTRAN 77, and Fortran 90. The most recent formal standard for the language, published in 1997, is known as Fortran 95. IBM's versions were never as popular as those developed by others, which was especially true of FORTRAN IV -- WATFOR, the version of FORTRAN IV developed at the University of Waterloo, Canada, was universally preferred because it produced better reports of compilation errors. The software for automatically generating flow charts from FORTRAN programs was also developed outside IBM.

Initially, the language relied on precise formatting of the source code and heavy use of statement numbers and goto statements. These quirks have been removed from newer versions of the language. Successive versions also introduced 'modern' programming concepts, such as source code comments and output of text, IF-THEN-ELSE (in FORTRAN 77), recursion (in Fortran 90), and parallel constructs, while still attempting to maintain Fortran's 'lean' profile and high performance. Among the most popular specialized Fortran-based languages were SAS, for generating statistical reports, and SIMSCRIPT, for simulating processes involving queuing.

Vendors of high performance scientific computers (Burroughs, CDC, Cray, IBM, Texas Instruments, ...) added extensions to Fortran to make use of special hardware features such as: instruction cache, CPU pipeline, vector arrays, etc. For example, one of IBM's Fortran compilers (H Extended IUP) had a level of optimization which reordered the machine code instructions to keep several internal arithmetic units busy at the same time. Another example is CFD, a special 'version' of Fortran designed specifically for the ILLIAC IV supercomputer, running at NASA's Ames Research Center. These extensions have either disappeared over time or had elements incorporated into the main standard; the major remaining extension is OpenMP[?], which is a cross-platform extension for shared memory programming. One new extension, CoArray Fortran[?], is intended to promote parallel programming.

As what was basically a first attempt at designing a high-level language, the language's syntax is regarded as arcane by many programmers who learned more modern languages. It is difficult to write a lexical analyser[?] for, and one-character mistakes can lead to runtime errors rather than compilation errors if more recent constructs such are not used. Some of the earlier versions, particularly, lacked facilities that would be regarded as useful in modern machines, such as dynamic memory allocation. At the same time, the syntax of Fortran has been tuned to scientific and numerical work, and many of its deficiencies have been addressed in more recent verisons. For example, Fortran 95 has very short commands for performing mathematical operations on matrices and arrays which not only greatly improves program readability but also provides useful information to the compiler to enable it to vectorize operations. For these reasons, Fortran is not often used outside scientific and engineering numerical analysis, but remains the language of choice for high performance numerical computing.

Standards

The two standards below reflect the current Fortran implementations.
  • ANSI X3.198-1992 (R1997). Title: Programming Language "Fortran" Extended. Informally known as Fortran 90. This standard was published by ANSI.
  • ISO/IEC 1539-1:1997. Title: Information technology - Programming languages - Fortran - Part 1: Base language. Informally known as Fortran 95. There are a further 2 parts to this standard. Part 1 has been formally adopted by ANSI.

Code Sample (Hello, World)

 c
 c   Hello, world.
 c
       Program Hello
 
       implicit none
       logical DONE
 
       DO while (.NOT. DONE)
         write(*,10)
       END DO
    10 format('Hello, world.')
       END

External links



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Johann Karl Friedrich Rosenkranz

... of Königsberg[?], where he remained till his death. In his last years he was quite blind. Throughout his long professorial career, and in all his numerous publications ...

 
 
 
This page was created in 31.7 ms