GEORGE (programming language): Difference between revisions

Content deleted Content added
mention uncanny resembleance to Forth by Moore. amazing likeness.
Reverted 1 edit by 50.163.162.160 (talk): Rv anachronistic typography changes (THIS BREAKS IT) and also move the editorial to the talk page. (TW)
Line 1:
* ((This seems to be identical to the programming language named [[Forth]], attributed to and designed by [[Moore_(Forth)]] - I don't know enough history to establish this, but the resemblamce is striking, and as a long-time user of Forth, I am surprised that ther eis no mention of Forth in either the text below or on the talk page. Fascinating! ))
 
In 1957, [[Charles Leonard Hamblin]] invented the [[programming language]] '''GEORGE'''.<ref >C. L. Hamblin [1957]: ''An addressless coding scheme based on mathematical notation.'' 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]: ''Computer Languages.'' The Australian Journal of Science, 20: 135-139. Reprinted in The Australian Computer Journal, 17(4): 195-198 (November 1985).</ref>
 
Line 9 ⟶ 7:
Algebraic expressions were written in reverse Polish notation; thus, <math>a + b</math> was written <code>a b +</code>, and similarly for the other arithmetic operations of subtraction, multiplication, and division.
 
The algebraic expression <math>ax^2 + bx + c</math> was written <code>a x dup × * *× b x *× + c +</code>, where '<code>dup</code>' meant 'duplicate the value'.
 
Following the reverse Polish form, an assignment statement to evaluate the formula <math>y = ax^2 + bx + c</math> was written as <code>a x dup × * *× b x *× + c + (y)</code>.
 
The computer evaluated the expression as follows: the values of <code>a</code>, then <code>x</code>, were pushed onto the top of the [[stack machine|accumulator stack]]; '<code>dup</code>' caused a copy of the top-most value (<code>x</code>) to be pushed onto the top of the accumulator stack; Multiply (<code> *×</code>) caused the top two values, namely, <code>x</code> and <code>x</code>, to be removed (popped) and multiplied, returning the product to the top of the accumulator stack. The second multiply (<code> *×</code>) then caused the top two values on the stack (namely, <code>a</code> and <code>x**2</code>) to be popped and multiplied, and the product (<code>a *xa×x**2</code>) to be pushed onto the top of the accumulator stack. And so on the remaining components of the expression. The final operation, namely (<code>y</code>), returned the value of the expression to storage without changing the status of the accumulator stack.
 
Assuming that the value on the top of the accumulator stack was not required immediately, it would be removed (cleared) by using the operator (<code>;</code>).
Line 71 ⟶ 69:
|-
! scope="row" | 4
| || OR || 4 || 20 || e || u || (e) || (u) || sqrt ||
|-
! scope="row" | 5
Line 77 ⟶ 75:
|-
! scope="row" | 6
| - || -v || 6 || 22 || g || w || (g) || (w) || cos ||
|-
! scope="row" | 7
| *× || -^ || 7 || 23 || h || x || (h) || (x) || ||
|-
! scope="row" | 8
Line 92 ⟶ 90:
|-
! scope="row" | 11
| max || || 11 || 27 || l || bβ || (l) || (bβ) || || P11
|-
! scope="row" | 12
| dup || || 12 || 28 || m || gγ || (m) || (gγ) || ||
|-
! scope="row" | 13
| rev || || 13 || 29 || n || lλ || (n) || (lλ) || ||
|-
! scope="row" | 14
| = || || 14 || 30 || Θ || mμ || (Θ) || (mμ) || ||
|-
! scope="row" | 15
| > || || 15 || 31 || p || wω || (p) || (wω) || ||
|}
 
Line 112 ⟶ 110:
if a > 0 go to 5 (which transfers to label 5 if a is greater than zero)
would be written
<pre>0 a > 5 -^ </pre>
 
Label 5 was indicated by including *5 elsewhere in the program.
Unconditional transfers were written 5-^5↑
 
Subroutine calls were made with the down arrow, .g., to call subroutine labelled 17, write 17-v17↓, where the label 17 was encoded using column 3 of the above table.
 
==Historical note==