Misplaced Pages

Fortran

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

A third-generation programming language ( 3GL ) is a high-level computer programming language that tends to be more machine-independent and programmer-friendly than the machine code of the first-generation and assembly languages of the second-generation , while having a less specific focus to the fourth and fifth generations. Examples of common and historical third-generation programming languages are ALGOL , BASIC , C , COBOL , Fortran , Java , and Pascal .

#563436

62-602: Fortran ( / ˈ f ɔːr t r æ n / ; formerly FORTRAN ) is a third generation , compiled , imperative programming language that is especially suited to numeric computation and scientific computing . Fortran was originally developed by IBM . It first compiled correctly in 1958. Fortran computer programs have been written to support scientific and engineering applications, such as numerical weather prediction , finite element analysis , computational fluid dynamics , plasma physics , geophysics , computational physics , crystallography and computational chemistry . It

124-565: A Formula Translating System , and printed the name with small caps , Fortran . Other sources suggest the name stands for Formula Translator , or Formula Translation . Early IBM computers did not support lowercase letters, and the names of versions of the language through FORTRAN 77 were usually spelled in all- uppercase . FORTRAN 77 was the last version in which the Fortran character set included only uppercase letters. The official language standards for Fortran have referred to

186-487: A complex number data type in the language made Fortran especially suited to technical applications such as electrical engineering. By 1960, versions of FORTRAN were available for the IBM 709 , 650 , 1620 , and 7090 computers. Significantly, the increasing popularity of FORTRAN spurred competing computer manufacturers to provide FORTRAN compilers for their machines, so that by 1963 over 40 FORTRAN compilers existed. FORTRAN

248-648: A high-level programming language replacement. John Backus said during a 1979 interview with Think , the IBM employee magazine, "Much of my work has come from being lazy. I didn't like writing programs, and so, when I was working on the IBM 701 , writing programs for computing missile trajectories, I started work on a programming system to make it easier to write programs." The language was widely adopted by scientists for writing numerically intensive programs, which encouraged compiler writers to produce compilers that could generate faster and more efficient code. The inclusion of

310-488: A blackjack game which are still the same today. The IBM 701 has a claim to be the first computer displaying the potential of artificial intelligence in Arthur Samuel 's checkers -playing program on February 24, 1956. The program, which was developed for play on the IBM 701, was demonstrated to the public on television. Self-proclaimed checkers master Robert Nealey played the game on an IBM 7094 computer in 1962 and

372-490: A capacity of 1024 bits each, giving a total memory of 2048 words of 36 bits each. Each of the 72 Williams tubes was 3 inches in diameter. Memory could be expanded to a maximum of 4096 words of 36 bits by the addition of a second set of 72 Williams tubes or (later) by replacing the entire memory with magnetic- core memory . The Williams tube memory and later core memory each had a memory cycle time of 12 microseconds. The Williams tube memory required periodic refreshing, mandating

434-510: A character data type (Fortran 77), structured programming , array programming , modular programming , generic programming (Fortran 90), parallel computing ( Fortran 95 ), object-oriented programming (Fortran 2003), and concurrent programming (Fortran 2008). Since April 2024, Fortran has ranked among the top ten languages in the TIOBE index , a measure of the popularity of programming languages. The first manual for FORTRAN describes it as

496-529: A committee of the Joint Chiefs of Staff requested that the two machines be compared for the purpose of using them for a Joint Numerical Weather Prediction project. Based on the trials, the two machines had comparable computational speed, with a slight advantage for IBM's machine, however when it came to input/output the 701 was favored unanimously for its significantly faster input/output equipment. Nineteen IBM 701 systems were installed. The first 701

558-582: A computer, an idea developed by J. Halcombe Laning and demonstrated in the Laning and Zierler system of 1952. A draft specification for The IBM Mathematical Formula Translating System was completed by November 1954. The first manual for FORTRAN appeared in October 1956, with the first FORTRAN compiler delivered in April 1957. Fortran produced efficient enough code for assembly language programmers to accept

620-452: A de facto standard), and Basic FORTRAN (based on FORTRAN II, but stripped of its machine-dependent features). The FORTRAN defined by the first standard, officially denoted X3.9-1966, became known as FORTRAN 66 (although many continued to term it FORTRAN IV, the language on which the standard was largely based). FORTRAN 66 effectively became the first industry-standard version of FORTRAN. FORTRAN 66 included: The above Fortran II version of

682-554: A language rather than just being a 3GL. A 3GL enables a programmer to write programs that are more or less independent from a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages, and hence require compilation or interpretation. In contrast, machine languages are considered low-level because they are designed for and executed by physical hardware without further translation required. The main advantage of high-level languages over low-level languages

SECTION 10

#1732793368564

744-476: A limit of six characters in FORTRAN II. If A, B, and C cannot represent the sides of a triangle in plane geometry, then the program's execution will end with an error code of "STOP 1". Otherwise, an output line will be printed showing the input values for A, B, and C, followed by the computed AREA of the triangle as a floating-point number occupying ten spaces along the line of output and showing 2 digits after

806-413: A number of significant features to address many of the shortcomings of FORTRAN 66: In this revision of the standard, a number of features were removed or altered in a manner that might invalidate formerly standard-conforming programs. (Removal was the only allowable alternative to X3J3 at that time, since the concept of " deprecation " was not yet available for ANSI standards.) While most of the 24 items in

868-421: A precision of about ten decimal digits. A decimal digit corresponds to l o g 2 10 {\displaystyle log_{2}10} or 3.322 bits. The IBM 701 had only two programmer accessible registers: The Magnetic Drum Reader/Recorder was added on the recommendation of John von Neumann , who said it would reduce the need for high speed I/O. The first magnetic tape drives were used on

930-498: A sequence number or text, which could be used to re-order cards if a stack of cards was dropped; though in practice this was reserved for stable, production programs. An IBM 519 could be used to copy a program deck and add sequence numbers. Some early compilers, e.g., the IBM 650's, had additional restrictions due to limitations on their card readers. Keypunches could be programmed to tab to column 7 and skip out after column 72. Later compilers relaxed most fixed-format restrictions, and

992-408: A simple means for FORTRAN 77 programmers to issue POSIX system calls. Over 100 calls were defined in the document – allowing access to POSIX-compatible process control, signal handling, file system control, device control, procedure pointing, and stream I/O in a portable manner. The much-delayed successor to FORTRAN 77, informally known as Fortran 90 (and prior to that, Fortran 8X ),

1054-546: A stack is maintained by software and the return address is stored on the stack before the call is made and restored after the call returns. Although not specified in FORTRAN 77, many F77 compilers supported recursion as an option, and the Burroughs mainframes , designed with recursion built-in, did so by default. It became a standard in Fortran 90 via the new keyword RECURSIVE. This program, for Heron's formula , reads data on

1116-432: A tape reel containing three 5-digit integers A, B, and C as input. There are no "type" declarations available: variables whose name starts with I, J, K, L, M, or N are "fixed-point" (i.e. integers), otherwise floating-point. Since integers are to be processed in this example, the names of the variables start with the letter "I". The name of a variable must start with a letter and can continue with both letters and digits, up to

1178-841: A way that favors the programmer, not the computer. A third generation language improves over a second-generation language by having the computer take care of non-essential details. 3GLs are more abstract than previous generations of languages, and thus can be considered higher-level languages than their first- and second-generation counterparts. First introduced in the late 1950s, Fortran , ALGOL , and COBOL are examples of early 3GLs. Most popular general-purpose languages today, such as C , C++ , C# , Java , BASIC and Pascal , are also third-generation languages, although each of these languages can be further subdivided into other categories based on other contemporary traits. Most 3GLs support structured programming . Many support object-oriented programming . Traits like these are more often used to describe

1240-502: Is a popular language for high-performance computing and is used for programs that benchmark and rank the world's fastest supercomputers . Fortran has evolved through numerous versions and dialects. In 1966, the American National Standards Institute (ANSI) developed a standard for Fortran to limit proliferation of compilers using slightly different syntax. Successive versions have added support for

1302-467: Is documented in Backus et al.'s paper on this original implementation, The FORTRAN Automatic Coding System : The fundamental unit of program is the basic block ; a basic block is a stretch of program which has one entry point and one exit point. The purpose of section 4 is to prepare for section 5 a table of predecessors (PRED table) which enumerates the basic blocks and lists for every basic block each of

SECTION 20

#1732793368564

1364-455: Is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or directly into behaviour by an interpreter. These programs could run on different machines (they are portable) so they were machine-independent. As new, more abstract languages have been developed, however, the concept of high- and low-level languages have become rather relative. Many of

1426-495: The DOUBLE PRECISION and COMPLEX data types. Early FORTRAN compilers supported no recursion in subroutines. Early computer architectures supported no concept of a stack, and when they did directly support subroutine calls, the return location was often stored in one fixed location adjacent to the subroutine code (e.g. the IBM 1130 ) or a specific machine register ( IBM 360 et seq ), which only allows recursion if

1488-497: The IBM 7030 ("Stretch") computer, followed by versions for the IBM 7090 , IBM 7094 , and later for the IBM 1401 in 1966. By 1965, FORTRAN IV was supposed to be compliant with the standard being developed by the American Standards Association X3.4.3 FORTRAN Working Group. Between 1966 and 1968, IBM offered several FORTRAN IV compilers for its System/360 , each named by letters that indicated

1550-542: The IBM System/360 in 1964. The business-oriented sibling of the 701 was the IBM 702 and a lower-cost general-purpose sibling was the IBM 650 , which gained fame as the first mass-produced computer. IBM 701 competed with Remington Rand's UNIVAC 1103 in the scientific computation market, which had been developed for the NSA , so it was held secret until permission to market it was obtained in 1951. In early 1954,

1612-411: The 1953 IBM annual stockholders' meeting. Watson Jr. was describing the market acceptance of the IBM 701 computer. Before production began, Watson visited with 20 companies that were potential customers. This is what he said at the stockholders' meeting, "as a result of our trip, on which we expected to get orders for five machines, we came home with orders for 18”. Aviation Week for 11 May 1953 says

1674-458: The 701 rental charge was about $ 12,000 (equivalent to $ 137,000 in 2023) per month; American Aviation 9 Nov 1953 says "$ 15,000 a month per 40-hour shift. A second 40-hour shift ups the rental to $ 20,000 a month". The successor of the 701 was the index register -equipped IBM 704 , introduced 4 years after the 701. The 704 was not compatible with the 701, however, as the 704 increased the size of instructions from 18 bits to 36 bits to support

1736-516: The Heron program needs several modifications to compile as a Fortran 66 program. Modifications include using the more machine independent versions of the READ and WRITE statements, and removal of the unneeded FLOATF type conversion functions. Though not required, the arithmetic IF statements can be re-written to use logical IF statements and expressions in a more structured fashion. After

1798-575: The Hollerith edit descriptors in the FORMAT statements with quoted strings. It also uses structured IF and END IF statements, rather than GOTO / CONTINUE . The development of a revised standard to succeed FORTRAN 77 would be repeatedly delayed as the standardization process struggled to keep up with rapid changes in computing and programming practice. In the meantime, as the "Standard FORTRAN" for nearly fifteen years, FORTRAN 77 would become

1860-527: The IBM 704 contained 32 statements , including: The arithmetic IF statement was reminiscent of (but not readily implementable by) a three-way comparison instruction (CAS—Compare Accumulator with Storage) available on the 704. The statement provided the only way to compare numbers—by testing their difference, with an attendant risk of overflow. This deficiency was later overcome by "logical" facilities introduced in FORTRAN IV. The FREQUENCY statement

1922-475: The University of Waterloo's WATFOR and WATFIV were created to simplify the complex compile and link processes of earlier compilers. In the FORTRAN IV programming environment of the era, except for that used on Control Data Corporation (CDC) systems, only one instruction was placed per line. The CDC version allowed for multiple instructions per line if separated by a $ (dollar) character. The FORTRAN sheet

Fortran - Misplaced Pages Continue

1984-563: The basic blocks which can be its immediate predecessor in flow, together with the absolute frequency of each such basic block link. This table is obtained by running the program once in Monte-Carlo fashion, in which the outcome of conditional transfers arising out of IF-type statements and computed GO TO's is determined by a random number generator suitably weighted according to whatever FREQUENCY statements have been provided. The first FORTRAN compiler reported diagnostic information by halting

2046-447: The character string. Miscounts were a problem. IBM's FORTRAN II appeared in 1958. The main enhancement was to support procedural programming by allowing user-written subroutines and functions which returned values with parameters passed by reference . The COMMON statement provided a way for subroutines to access common (or global ) variables. Six new statements were introduced: Over the next few years, FORTRAN II added support for

2108-508: The computer won. It is still considered a milestone for artificial intelligence and it offered the public during the early 1960s an example of the capabilities of an electronic computer. The University of California Radiation Laboratory at Livermore developed a language compilation and runtime system called the KOMPILER for their IBM 701. Speedcode was the first high-level programming language created for an IBM computer. The language

2170-487: The conflict list (see Appendix A2 of X3.9-1978) addressed loopholes or pathological cases permitted by the prior standard but rarely used, a small number of specific capabilities were deliberately removed, such as: A Fortran 77 version of the Heron program requires no modifications to the Fortran 66 version. However this example demonstrates additional cleanup of the I/O statements, including using list-directed I/O, and replacing

2232-556: The decimal point, the .2 in F10.2 of the FORMAT statement with label 601. IBM also developed a FORTRAN III in 1958 that allowed for inline assembly code among other features; however, this version was never released as a product. Like the 704 FORTRAN and FORTRAN II, FORTRAN III included machine-dependent features that made code written in it unportable from machine to machine. Early versions of FORTRAN provided by other vendors suffered from

2294-479: The early "high-level" languages are now considered relatively low-level in comparison to languages such as Python , Ruby , and Common Lisp , which have some features of fourth-generation programming languages and were called very high-level programming languages in the 1990s. IBM 701 The IBM 701 Electronic Data Processing Machine , known as the Defense Calculator while in development,

2356-640: The early history of FORTRAN was the decision by the American Standards Association (now American National Standards Institute (ANSI)) to form a committee sponsored by the Business Equipment Manufacturers Association (BEMA) to develop an American Standard Fortran . The resulting two standards, approved in March 1966, defined two languages, FORTRAN (based on FORTRAN IV, which had served as

2418-429: The error. Before the development of disk files, text editors and terminals, programs were most often entered on a keypunch keyboard onto 80-column punched cards , one line to a card. The resulting deck of cards would be fed into a card reader to be compiled. Punched card codes included no lower-case letters or many special characters, and special versions of the IBM 026 keypunch were offered that would correctly print

2480-488: The extra features. The 704 also marked the transition to magnetic-core memory . In 1952, IBM paired with language scholars from Georgetown University to develop translation software for use on computers. On January 7, 1954, the team developed an experimental software program that allowed the IBM 701 computer to translate from Russian to English. This was the Georgetown–IBM experiment . The Mark 1 Translating Device, which

2542-526: The historically most important dialect. An important practical extension to FORTRAN 77 was the release of MIL-STD-1753 in 1978. This specification, developed by the U.S. Department of Defense , standardized a number of features implemented by most FORTRAN 77 compilers but not included in the ANSI FORTRAN 77 standard. These features would eventually be incorporated into the Fortran 90 standard. The IEEE 1003.9 POSIX Standard, released in 1991, provided

Fortran - Misplaced Pages Continue

2604-470: The insertion of refresh cycles into the 701's timing. An addition operation required five 12-microsecond cycles, two of which were refresh cycles, while a multiplication or division operation required 38 cycles (456 microseconds). In addition, magnetic drum and magnetic tape were utilized for secondary storage. Instructions were 18 bits long, single address. Numbers were either 36 bits or 18 bits long, signed magnitude , fixed point . The full word has

2666-522: The language as "Fortran" with initial caps since Fortran 90. In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more practical alternative to assembly language for programming their IBM 704 mainframe computer . Backus' historic FORTRAN team consisted of programmers Richard Goldberg, Sheldon F. Best, Harlan Herrick, Peter Sheridan, Roy Nutt , Robert Nelson, Irving Ziller, Harold Stern, Lois Haibt , and David Sayre . Its concepts included easier entry of equations into

2728-662: The minimum amount of memory the compiler needed to run. The letters (F, G, H) matched the codes used with System/360 model numbers to indicate memory size, each letter increment being a factor of two larger: Digital Equipment Corporation maintained DECSYSTEM-10 Fortran IV (F40) for PDP-10 from 1967 to 1975. Compilers were also available for the UNIVAC 1100 series and the Control Data 6000 series and 7000 series systems. At about this time FORTRAN IV had started to become an important educational tool and implementations such as

2790-405: The program when an error was found and outputting an error code on its console. That code could be looked up by the programmer in an error messages table in the operator's manual, providing them with a brief description of the problem. Later, an error-handling subroutine to handle user errors such as division by zero, developed by NASA, was incorporated, informing users of which line of code contained

2852-481: The re-purposed special characters used in FORTRAN. Reflecting punched card input practice, Fortran programs were originally written in a fixed-column format, with the first 72 columns read into twelve 36-bit words. A letter "C" in column 1 caused the entire card to be treated as a comment and ignored by the compiler. Otherwise, the columns of the card were divided into four fields: Columns 73 to 80 could therefore be used for identification information, such as punching

2914-621: The release of the FORTRAN 66 standard, compiler vendors introduced several extensions to Standard Fortran , prompting ANSI committee X3J3 in 1969 to begin work on revising the 1966 standard, under sponsorship of CBEMA , the Computer Business Equipment Manufacturers Association (formerly BEMA). Final drafts of this revised standard circulated in 1977, leading to formal approval of the new FORTRAN standard in April 1978. The new standard, called FORTRAN 77 and officially denoted X3.9-1978, added

2976-464: The requirement was eliminated in the Fortran 90 standard. Within the statement field, whitespace characters (blanks) were ignored outside a text literal. This allowed omitting spaces between tokens for brevity or including spaces within identifiers for clarity. For example, AVG OF X was a valid identifier, equivalent to AVGOFX , and 101010 DO101I = 1 , 101 was a valid statement, equivalent to 10101 DO 101 I = 1 , 101 because

3038-428: The same disadvantage. IBM began development of FORTRAN IV in 1961 as a result of customer demands. FORTRAN IV removed the machine-dependent features of FORTRAN II (such as READ INPUT TAPE ), while adding new features such as a LOGICAL data type , logical Boolean expressions , and the logical IF statement as an alternative to the arithmetic IF statement. FORTRAN IV was eventually released in 1962, first for

3100-470: The zero in column 6 is treated as if it were a space (!), while 101010 DO101I = 1.101 was instead 10101 DO101I = 1.101 , the assignment of 1.101 to a variable called DO101I . Note the slight visual difference between a comma and a period. Hollerith strings , originally allowed only in FORMAT and DATA statements, were prefixed by a character count and the letter H (e.g., 26HTHIS IS ALPHANUMERIC DATA. ), allowing blanks to be retained within

3162-456: Was IBM ’s first commercial scientific computer and its first series production mainframe computer , which was announced to the public on May 21, 1952. It was designed and developed by Jerrier Haddad and Nathaniel Rochester and was based on the IAS machine at Princeton . The IBM 701 was the first computer in the IBM 700/7000 series , which were IBM’s high-end computers until the arrival of

SECTION 50

#1732793368564

3224-506: Was a minor revision, mostly to resolve some outstanding issues from the Fortran 90 standard. Nevertheless, Fortran 95 also added a number of extensions, notably from the High Performance Fortran specification: Third-generation programming language 3GLs are much more machine-independent and more programmer-friendly. This includes features like improved support for aggregate data types, and expressing concepts in

3286-480: Was also standard-conforming under Fortran 90, and either standard should have been usable to define its behavior. A small set of features were identified as "obsolescent" and were expected to be removed in a future standard. All of the functionalities of these early-version features can be performed by newer Fortran features. Some are kept to simplify porting of old programs but many were deleted in Fortran 95. Fortran 95 , published officially as ISO/IEC 1539-1:1997,

3348-442: Was available (at least for the early IBM 1620 computer). Modern Fortran, and almost all later versions, are fully compiled, as done for other high-performance languages. The development of Fortran paralleled the early evolution of compiler technology , and many advances in the theory and design of compilers were specifically motivated by the need to generate efficient code for Fortran programs. The initial release of FORTRAN for

3410-594: Was delivered to IBM's world headquarters in New York. Eight went to aircraft companies. At the Lawrence Livermore National Laboratory , having an IBM 701 meant that scientists could run nuclear explosives computations faster. "I think there is a world market for maybe five computers" is often attributed to Thomas Watson Sr. , chairman and CEO of IBM, in 1943. This misquote may stem from a statement by his son, Thomas Watson Jr. at

3472-478: Was developed by John Backus in 1953 for the IBM 701 to support computation with floating-point numbers . The Fortran compiler also developed by Backus was not released by IBM until the IBM 704 . The IBM 701 system was composed of the following units: The total weight (depending on configuration) was about 20,516 pounds (10.3 short tons; 9.3 t). The system used vacuum tube logic circuitry and electrostatic storage, consisting of 72 Williams tubes with

3534-485: Was developed for the US Air Force, was able to produce its first automated Russian-to-English translation in 1959 and was shown to the public in 1964. In 1954, a group of scientists ran millions of simulated hands of blackjack on an IBM 701 looking to determine the best playing decision for every combination of cards. The result of the study was the set of correct rules for hitting, standing, doubling or splitting in

3596-428: Was divided into four fields, as described above. Two compilers of the time, IBM "G" and UNIVAC, allowed comments to be written on the same line as instructions, separated by a special character: "master space": V (perforations 7 and 8) for UNIVAC and perforations 12/11/0/7/8/9 (hexadecimal FF) for IBM. These comments were not to be inserted in the middle of continuation cards. Perhaps the most significant development in

3658-409: Was finally released as ISO/IEC standard 1539:1991 in 1991 and an ANSI Standard in 1992. In addition to changing the official spelling from FORTRAN to Fortran, this major revision added many new features to reflect the significant changes in programming practice that had evolved since the 1978 standard: Unlike the prior revision, Fortran 90 removed no features. Any standard-conforming FORTRAN 77 program

3720-407: Was provided for the IBM 1401 computer by an innovative 63-phase compiler that ran entirely in its core memory of only 8000 (six-bit) characters. The compiler could be run from tape, or from a 2200-card deck; it used no further tape or disk storage. It kept the program in memory and loaded overlays that gradually transformed it, in place, into executable form, as described by Haines. This article

3782-480: Was reprinted, edited, in both editions of Anatomy of a Compiler and in the IBM manual "Fortran Specifications and Operating Procedures, IBM 1401". The executable form was not entirely machine language ; rather, floating-point arithmetic, sub-scripting, input/output, and function references were interpreted, preceding UCSD Pascal P-code by two decades. GOTRAN , a simplified, interpreted version of FORTRAN I (with only 12 statements not 32) for "load and go" operation

SECTION 60

#1732793368564

3844-489: Was used originally (and optionally) to give branch probabilities for the three branch cases of the arithmetic IF statement. It could also be used to suggest how many iterations a DO loop might run. The first FORTRAN compiler used this weighting to perform at compile time a Monte Carlo simulation of the generated code, the results of which were used to optimize the placement of basic blocks in memory—a very sophisticated optimization for its time. The Monte Carlo technique

#563436