From Programmer to Computer

told what to do, and will do only exactly what they are told. They will not correct errors in their instructions or supply missing information or inst...
1 downloads 0 Views 168KB Size
I

GRACE M. HOPPER ’

Remington Rand Univac Division, Sperry-Rand Corp., Philadelphia 29, Pa.

From Programmer to Computer A computer’s results are directly dependent on the people who use it

COMPUTERS

b

are extraordinarily fast, flexible, and efficient. They will not do anything until they are told what to do, and will do only exactly what they are told. They will not correct errors in their instructions or supply missing information or instructions. One error in the instructions may result in fantastic chaosand without a single malfunction on the part of the computer. Programming. The preparation of the detailed list of instructions to a computer, called programming, can be divided in two parts: planning and logistics. Planning involves both strategy and tactics. I t ranges from consideration of entire operations-from writing a requisition, through paying the bill-designing test equipment to produce data which can be processed to yield desired information, down to counting the number of items processed. It includes everything from selection of the numerical method for the approximation of the solution of a partial differential equation to deciding how to obtain a square root in a particular range. As the art has developed, two stages have been distinguished-programming, which lies between analysis of the problem and detailed coding, and coding. A program prepared as flow charts or diagrams, can be used on more than one computer, while coding is written in the language of a specific computer. Logistics is having the right thing, in the right place, at the right time. A balance between instructions afid data must always be maintained. In early computers, data and instructions were crammed into storage and the computer took off at high speed and ultimately emitted results which were unloaded and printed. This was satisfactory for many mathematical, scientific, and engineering problems, but not for commercial and data reduction problems. Here, the data are usually too plentiful to be crammed into the computer. In the early days the programmer was the technical jack-of-all-trades. Gradually, specially trained electronic technicians took over the function of operator. Much later came separation of programmer and coder. Within the last few years, it has begun to be possible to replace the coder by the computer itself, as the new field of automatic coding- interpretation, assembly, and compiling-has been developed.



Of particular value to scientists are the “natural languages’’ pseudo-codes and their corresponding compiling systems (7). Outstanding are Fortran for the IBM 704, Unicode for the Univac 1103a, and Math-Matic for the Univac I and 11. Others of particular interest are the PACT system on the West Coast and the IT system of Alan Perlis, Carrlegie Institute. Definitions. A pseudo-code is a rather strictly defined language or code, independent of the computer hardware, resembling a natural language, in which a problem may be stated for submission to a computer. An executive or master routine called a compiler interprets and processes the pseudo-code and produces a program or list of instructions by which the computer may solve the problem. During this process it uses a library containihg subroutines (previously prepared and tested sections of coding) and generators (routines capable of making subroutines). A compiler can decode, select, generate, collect, allocate, assemble, and record. Thus the compiler and computer replace the coder, once the problem has been stated in pseudo-code. Suppose it is desired to evaluate the function Y =

+,

notation of mathematics, -, *, /; numerical exponents, positive, negative, and fractional; elementary algebraic, trigonometric, and exponential functions, sin, cos, tan, log, etc.; and English words where mathematical symbols are not available on the computer TYPEWRITER-Sum, Variance, Sumsquares, Mean, Read, Write, Jump, Array, Execute, Edit, A POW X meaning A”, PRINT-OUT, IF A = B, JUMP T O SENTENCE 10. Now the chemist, physicist, mathematician, statistician, engineer can use the computer for computation without communicating through a coder. Much time and programming effortat least 20 man-years-on the part of highly trained programmers can easily go into preparation of the compiler that receives such pseudo-code and produces a running program. Another area of the data-processing field, business data-processing, evoked another compiler. Here no symbolic notation existed, so the pseudo-code had to be English words. Sentences from problems take the forms: (13) COMPARE INV-ON-HAND (A) WITH INV-LIMIT (B): IF

of^' - +CQ for various ranges of

X , A, and P. The equation can be written in Math-Matic pseudo-code as: (4) Y = X8* (2+X)/(3*COS A ) - (3* P)1/4. The conventions are simple-when in doubt use parentheses, star means multiply, space between the name of a function (COS) and the variable ( A ) . Next, define the ranges of X , A , and P. This requires three sentences, one for each variable, and must be stated ahead of the formula to be evaluated (sentence 4). These ranges must cover the description of the desired output. (5) EDIT AND WRITE Y , X,A , P.

Now it can be stated: (1) VARY P 0.2(0.2)0.8 SENTENCES 2 THRU 5. ( 2 ) VARY A 0.35(0.175H.05 SENTENCES 3 THRU 5. ( 3 ) VARY X 1.8 (0.5) 3.8 SENTENCES 4 THRU 5.

.,

Use zero preceding a decimal point and spaces to separate the quantities. The problem is complete, except for one thing that is alwaysnecessary: (6) STOP. The pseudo-code includes the normal

AS ADJ-PAY (W).’

,,

(18) COMPARE STOCK-NO (A) WITH STOCK-NO (B); IF GREATER GO TO OPERATION 21 ; IF EQUAL GO T O OPERATION 27: OTHERWISE GO TO OPERATION 39.

Variables may be any type of set of alpha-numeric quantities. They may also be computer instructions, and this compiler can be used to produce compilers. I t is beginning to be possible to make these powerful executive routines automatically-to produce master routines that will tailor a computer to the pseudocode desired by, and most familiar to, the user. While this will not be achieved tomorrow or the next day, it will be achieved within the next five years and maybe much sooner. literature Cited

(1) Bemer, R. W., Proc. 4th Annual Computer Applications Symposium, Armour Research Foundation, Chicago,Ill., 1957. RECEIVED for review May 9, 1958 ACCEPTED July 29, 1958

vol.’

50, NO. 11

NOVEMBER 1598

1 66 1