A programming language blog on Fortran, Algol, Ada, and C, covering language history, features, and teaching coding.
HN links it for early language history, such as Algol-60 introducing recursion, and uses it alongside Dijkstra's critiques of language designs.
Has anyone found the source for that tablet? All I have found is this:
>Note that quite a few descriptions on Babylonian tablets seem to cite a translation of a Pythagorean algorithm from a ca. 1900BC tablet by a Dennis Ramsey – I have not been able to find the original source of this anywhere.[0]
The linked arctile cites wikipedia and bible-history.com. This book[1] misquotes the supposed tablet as being ycb 7289, probably because these tablets are referenced next to each other on wikipedia.
This[2] website says it's in the British museum.
[0]https://craftofcoding.wordpress.com/author/spqr/
[1]https://books.google.com/books?id=XDBCEAAAQBAJ&pg=PT257&lpg=PT257&dq=%224+is+the+length+and+5+is+the+diagonal.+What+is+the+breadth?+Its+size+is+not+known.+4+times+4+is+16.+And+5+times+5+is+25.+You+take+16+from+25+and+there+remains+9.+What+times+what+shall+I+take+in+order+to+get+9?+3+times+3+is+9.+3+is+the+breadth%22&source=bl&ots=rpq5LBD67m&hl=en&sa=X&ved=2ahUKEwj514O-hN-BAxWmvokEHZDhCV0Q6AF6BAgJEAE#v=onepage&q=%224%20is%20the%20length%20and%205%20is%20the%20diagonal.%20What%20is%20the%20breadth%3F%20Its%20size%20is%20not%20known.%204%20times%204%20is%2016.%20And%205%20times%205%20is%2025.%20You%20take%2016%20from%2025%20and%20there%20remains%209.%20What%20times%20what%20shall%20I%20take%20in%20order%20to%20get%209%3F%203%20times%203%20is%209.%203%20is%20the%20breadth%22&f=false
[2]https://mathshistory.st-andrews.ac.uk/HistTopics/Babylonian_Pythagoras/
I've just looked at this snippet, which the blog used back in 2017 to illustrate that Algol 68 was "utter madness": https://craftofcoding.wordpress.com/2017/03/06/a-brief-look-at-the-utter-madness-of-algol-68/
COMMENT Algol 68 program to calculate the Sieve of Eratosthenes for some upper limit N COMMENT PROC eratosthenes = (INT n) []INT: ( [n]INT sieve; FOR i TO UPB sieve DO sieve[i] := i OD; INT k = ENTIER sqrt(n); sieve[1] := 0; FOR i FROM 2 TO k DO IF sieve[i] NE 0 THEN FOR j FROM i*i BY i TO n DO sieve[j] := 0 OD FI OD; sieve ); INT n; print("Upper limit to calculate sieve? "); read(n); print((eratosthenes(n), newline)) A few things: This code is very readable. The blogger didn't understand it because he didn't understand what the "Sieve of Eratosthenes" did: It's a means of calculating lists of prime numbers. He incorrectly stated that it was used for calculating Fibonacci numbers.
Syntax-wise, it looks like some mix of Go, C and Python. Nothing at all unusual. It would be pretty easy to learn to program in this, and comfortable too.
[Edit: The blogger later demonstrated a good understanding of the Sieve of Eratosthenes, but still expressed criticism of Algol68: https://craftofcoding.wordpress.com/2021/04/06/algorithm-35-the-sieve-in-algol-68/]
One feature, as far as I can tell, that no languages had until Algol-60 was recursion (https://craftofcoding.wordpress.com/2020/12/01/recursion-the-algol60-years/).
It's hard to imagine nowadays how controversial this was. Previous versions of Algol did not necessarily require any form of dynamic memory allocation. Recursion requires it in some form to avoid overwriting a procedure's variables upon the recursive call.
Languages that forbid recursion (like Fortran before F90) can allocate for peak memory usage before runtime, which is especially useful on RAM-poor computers.
EDIT: The site also has a great quote on the subject (https://craftofcoding.wordpress.com/2022/10/20/d%c8%b3kstra-on-the-difficulty-of-recursion/).
Some biting critiques from Edsger Dijkstra:
Red: “the proposal is both advanced and backward in such an incongruous manner that I am baffled”
Green: “technical incompetence, probably enhanced by dishonesty”
Blue: “the blue language is unacceptably complex” … “these documents are an inextricable mixture of technical documentation and salestalk”
Yellow: “an unsalvageable mess”
https://craftofcoding.wordpress.com/2014/04/16/dijkstra-on-ada/
That reminds me of this program, which calculates the month and day given the year and the day of the year [0]. There's a version that abuses goto, and one that stores state in variables and only uses structured statements. You probably won't see people similarly abuse goto today, though. I think it was translated from Fortran.
[0]: https://craftofcoding.wordpress.com/2020/02/12/the-world-of-unstructured-programming-i-e-spaghetti-code/
I've always considered Fortran to be the "first", but with some quick research, it looks like Algol was the first C-like lang to add an if/then statement. My guess is that the author was trying to approximate modern imperative programming.
[1] https://craftofcoding.wordpress.com/2021/01/11/why-algol-bested-fortran-for-a-bit/