4 ms·
I once glanced through some explanation of monads by Simon Peyton Jones. He said that in ALGOL specification, the semicolon operator is formally defined as taki
by avodonosov 4y ago
I once glanced through some explanation of monads by Simon Peyton Jones. He said that in ALGOL specification, the semicolon operator is formally defined as taking the current state of the world, transforming it by the statements preceding the semicolon, and then arranging for the program to continue execution in this new world.
So John Backus not only suggested "Applicative State Transition" in his paper. He participated in ALGOL creation. Which influenced most contemporary languages.
We have this style of programming in our Pascal and Java programs.
Please no new names. Semicolon is semicolon.
Sorry, I can't find this blog or paper by Peyton Jones. Leaving that as an exercise for the reader :)
And of course, I can misremember something.
- nerdponx 4y agoNow if we could only statically reason about updates to the world state...
- avodonosov 4y agoI must be missing something. The Backus publication referenced by OP is from 1978, much later than Algol. Maybe the OP means some substantial difference, but I don't see what exactly. And indeed, the Backus publication even has a section "14.2 The Structure of Algol Compared to That of AST Systems".
- hgsgm 4y ago
- aappleby 4y agoAuthor here. From the Algol viewpoint, you can think of a temporal program as one enormous statement followed by a semicolon, embedded in a while(1) loop. Semicolon is semicolon, but in Pascal/Java you have lots of tiny semicolons and in a temporal program you have one giant semicolon. The practical implications of that are more wide-ranging than you think, and quite interesting.