GEORGE (programming language): Difference between revisions

Content deleted Content added
Robin400 (talk | contribs)
m improved expression
Robin400 (talk | contribs)
New material for vectors
Line 1:
In 1957, [[Charles Leonard Hamblin]] invented the programming language GEORGE.<ref>
C. L. Hamblin [1957]: <i>An addressless coding scheme based on mathematical notation.</i> Proceedings of the First Australian Conference on Computing and Data Processing, Salisbury, South Australia: Weapons Research Establishment, June 1957.</ref>
<ref>C. L. Hamblin [1957]: <i>Computer Languages.</i> The Australian Journal of Science, 20: 135-139. Reprinted in The Australian Computer Journal, 17(4): 195-198 (November 1985).</ref>
It was designed around a push-down pop-up stack for arithmetic operations, and employed reverse Polish notation.
The language included loops, subroutines, conditionals, vectors, and matrices.
Line 32:
After the loop terminates, the (P) causes the final sum to be punched on a card.
 
Manipulation of vectors and matrices requires subscript notation. In GEORGE, the subscript(s) preceded the vector or matrix name. Thus A(j) was written j | A.
The following program reads in vector <i>a</i> of 10 values, then forms the squares of those values, and finally prints those values.
<pre>
1, 10 R1 (a)
1, 10 rep (j)
j | a dup * j | (a) ;
]
1, 10 P1 (a)
</pre>
In the program, the first line is a vector read that reads in the ten values into a(1) through a(10).
The second line introduces a loop to run though the ten values of j.
The third line fetches a(j), duplicates it, multiplies those two values giving the square, and then stores it in a(j). Note the semicolon (;), which clears (or cancels) the top entry in the accumulator stack. Were this not done, the accumulator would gradually fill up with the squares of the values.
The final line is a vector punch (i.e., print) to write out the ten squares.
 
==Historical note==
In the the first version running by May 1957 on an English Electric DEUCE, all values were stored in binary fixed-point form in a 32-bit word, with 16 binary places.
 
In the second version introduced by 1958, values were held in floating-point form, with
one value per word: 22 bits for the mantissa and 10 bits for the exponent.
==References==
<references/>