Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
The Fortran programming language
1. The Fortran programming language
2. Fortran
Fortran is an imperative programming language was developed IBM, first appeared in 1957, and was marketed as making debugging obsolete. The name was originally "
FORTRAN" (all uppercase letters) for "
Formula Translator" but is now "
Fortran".
The effect of high level programming languages was that it actually did make it easier to program than assembly language, made programs more portable, increased the size of code bases, but debugging was still needed.
The
BASIC (Beginners All Purpose Symbolic Instruction Code) programming language was later designed as an (interpreted) simplification of Fortran II.
3. Fran Allen
Fran Allen was one of the people working on the Fortran project.
Frances Elizabeth "Fran" Allen (born August 4, 1932) is an American computer scientist and pioneer in the field of optimizing compilers. Allen was the first female IBM Fellow and in 2006 became the first woman to win the Turing Award. Her achievements include seminal work in compilers, program optimization, and parallelization. (Wikipedia)
4. Computed goto
Here is the Fortran code to show the use of a computed goto.
C File: DAYS-06.FOR
PROGRAM days
INTEGER d
READ *,d
GOTO(10,11,12,13,14,15,16) d
10 PRINT *,'Sun'
GOTO 20
11 PRINT *,'Mon'
GOTO 20
12 PRINT *,'Tue'
GOTO 20
13 PRINT *,'Wed'
GOTO 20
14 PRINT *,'Thu'
GOTO 20
15 PRINT *,'Fri'
GOTO 20
16 PRINT *,'Sat'
GOTO 20
20 END
5. Sort
Here is a simple sort/swap example in Fortran.
C File: SORT-02.FOR
PROGRAM sort2
INTEGER x,y,t
READ *,x,y
C { Pre: (x = a) and (y = b) }
IF (x .GT. y) THEN
t= x
x= y
y= t
ELSE
x= x
y= y
ENDIF
C { Post: (x <= y) and (((x=a) and (y=b)) or ((x=b) and (y=a))) }
PRINT *,x,y
END
6. Scientific computation
Fortran was and is still used for scientific computation. There is little new software created in Fortran, but a huge code base of existing Fortran code libraries exist and is still used.
Bot Fortran had issues that related to the presence and use of the goto statement.
7. Experiments
In the good old days physicists repeated each other's experiments, just to be sure. Today they stick to Fortran, so that they can share each other's programs, bugs included. Dijkstra, E. (June 18, 1975). "How do we tell truths that hurt?", EWD 498.
Edsger Dijkstra (computer scientist)
8. Fortran
Fortran -- "the infantile disorder" --, by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use. Dijkstra, E. (June 18, 1975). "How do we tell truths that hurt?", EWD 498.
Edsger Dijkstra (computer scientist)
Comments such as this were not appreciated by the large number of professional programmers whose jobs involved using Fortran on a daily basis.
9. Fortran assignment statement
In the assignment statement
x = x + y
If variable
y were not declared, Fortran declares it. Often, the initial value is
0.
Note: Fortran
10. Fortran if statement
x = 1
IF (x .eq. 0) THEN
x = x + 1
ELSE x = x + 2
ENDIF
Assume that the above Fortran statements are executed. What is the final value of
x?
11. Fortran
Fortran ignores spaces in a statement. So, the following are equivalent statements.
freq=1.0
f r e q = 1 . 0
12. Fortran example
By adding a type system to a subset of Fortran and using that subset, you can avoid these problems while still using standard Fortran.
13. C
The C program called lint is used to detect certain problems when using C.
Many languages have "lint" programs, sometimes called a "linter". JavaScript is one of the most popular (due to many bad features in JavaScript).
14. John Backus
After 20 years of ubiquitous Fortran use in the industry, in the 1970's, computer scientist John Backus (Extended and Backus-Naur form grammars are named for him) wrote an important article that laid out the reasons why Fortran was not a good way to develop programs.
Backus proposed that functional programming, using his somewhat cryptic language
FP (Functional Programming) would be much better as a way to develop correct, modular, and compositional software programs.
At the time, most programmers ignored or laughed at him and went happily along continuing to develop and write Fortran programs.
Now, almost 50 years later, those functional programming language concepts have crept into every popular programming system - JavaScript, Python, Lua, C#, and even Java.
According to Kuhn, this is about the time for one generation to leave and the next take over with the needed changes.
Who was this John Backus anyway, who had the audacity to propose replacing Fortran with a better way to program?
The point of all this is that even when you can see the future (Alan Kay would say it is better to invent the future, perhaps along the lines what Steve Jobs accomplished) do not expect that needed change to happen very fast or even be recognized within your lifetime.
15. End of page