ALGOL 68 Instead of Pascal? - Computerphile
HTML-код
- Опубликовано: 25 авг 2024
- Computer Scientists had to make choices for what system to use for different student use cases. Professor Brailsford on whether to choose Algol 68 or Pascal. Or both.
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottsco...
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com
3:56 ALGOL 68 had its own terminology for so many things: types were called “modes”, addresses/pointers/references were called “names”, and instead of saying “input/output” or “I/O”, they coined the term “transput”.
Transput is an awesome term! We need to bring that back.
I think they also introduced “overloading” for multiple definitions of an operator that were chosen according to context. That term is commonplace nowadays.
So that's the reason why INTERCAL has its own terminology. xD
For a parody esolang, that was sure the best joke they could pull out.
When I was at the University of Alberta (Canada) in the late '70s and early '80s, our first year, first semester language was Algol W, a descendant of Algol 60 (and APL, but that's another story). The things that I could not get my head around were records and references. I don't know if I was thick or if the explanation was just not well done, but it took a while before I caught on. Now we know them as structs and pointers in C.
The forth year undergrads and grad students were using Algol68 (see FLACC), and we heard rumors of storing code in data structures, constants in base-27, and other dark magic.
When we got to second year, UAlberta introduced Pascal for the undergrads. That was a language that made sense to me. I even used Pascal in my compiler construction class that was taught by B J Mailloux (time index 5:28) where we were tasked with writing an integer Algol 60.
ALGOL-W was also known as “Wirth-Hoare ALGOL”. Think of it as a prototype of ideas that Wirth would later embody in Pascal.
Is that the origin of the term 'cast' in programming? If so that's an amazing accomplishment.
It's always wonderful hearing from Professor Brailsford! It must have been amazing to work and teach in what was such a revolutionary field at the time. Thank you for sharing your insights with us Professor! :-)
Yes yes, glad to see you're doing well Prof!
A couple of significant notational differences between C and Pascal are, when declaring variables, C inherits the Algol syntax of type-spec before variable name: “«type-spec» «var-name»” whereas Pascal invented its own syntax: “«var-name» : «type-spec»”. And also pointer dereferencing: C uses a prefix operator “*«pointer-val»” whereas Pascal has a postfix one: “«pointer-val»^”.
This may seem very tomayto-tomahto, but consider how C++, which inherits C syntax lock stock and barrel, is now trying to deal with newer features involving dependencies between types, for example between the arguments to a function and its result type. It now finds that, in addition to the C syntax of putting the return type before the function name, it also has to add an alternative syntax where the return type comes after the argument list, _à la_ Pascal.
As for the pointer issue, this may not occur very often, but back in my Mac programming days, more than once I had to write an expression like “thePort^^.theGDevice^^.gdPMap^^.pmTable”,
which in C would have had to become “(**(**(**thePort).theGDevice).gdPMap).pmTable”. (These were structures defined for interfacing to the Mac system, not created by me.) Which would you prefer?
I wonder what you may think of current version of Free Pascal... Because it's way different from the 70's.
I would probably say ```thePort[0]->theGDevice[0]->gdPMap[0]->pmTable```, but I agree that pointers to pointers inside structures look clumsy. Shame on Apple for using those.
Regarding the theological issue of whether variable declarations should bring first the name or the type, I agree that starting with the name is better because it is in a more visible location (which is why when I write C myself I break a line between the type of a method and its name so it starts in column 0), but it is indeed a question of style, or _tomayto-tomahto,_ as you say. We can definitely cope with programming using both paradigms without difficulty.
It wasn’t Apple’s fault for coming up with a situation that C cannot handle gracefully.
@@lawrencedoliveiro9104 It's not bad because C cannot handle it gracefully (the -> operator is there as syntactic sugar for (*).), it's that there is no need to keep a double pointer in a structure unless you're doing an array of references, which does not seem to be the case (though I have not programmed that particular interface myself to affirm it categorically). If you need to change the object the structure is pointing to then you go and overwrite the pointer, since you have the structure on hand. This is the same whether you're writing C, Pascal, Python or Rust.
@@tiagorodrigues3730 Data in classic Mac OS was meant to be moved around to compact ram usage. To allocate memory, you requested the OS a “handle” (pointer to pointer), not a pointer. Any pointer could potentially be invalid after the next allocation/deallocation.
My father worked at RRE (in the period before this video discusses -- late 50's) and he was responsible for building the 1st core memory in the UK (as he told the story).
He got the on site carpentry shop to build the wooden frames and local housewifes, who were avid knitters, were brought to thread the x,y and sense wires through the cores.
The way he speaks, he sounds like David Attenborough of Computer Science. 😂
I agree
But he is the David Attenborough of Computer Science.
winnie the pooh of computer science
the Type Casting now makes sense WOW. I'm going ask all my programmer friends if they know why type "casting" is called casting :D
"Well, you have a thing and you cast it against the wall and see what falls out of it."
So many terms from CS come from the most intriguing origins, got to admit. (edit: bootstrapping for instance 😉)
'So you cast your fishing line out over the water, hook some type, and then reel it in...'
I did a lot of Algol W and Pascal as an undergrad (late '70s/early '80s). One of my profs was the same Dr. Peck who co-wrote the Algol 68 report. He thought BCPL was the way to do things, but Algol 68 was a newcomer with potential. He also felt that C (also a newcomer at the time) was an offence against all that was free and right and holy.
Heh, predicting the future was never easy, and will never be. Funny how decades ago people were calling C ridiculous, and now C is like the golden standard
When he saw C++, did he have a heart attack?
BCPL was really a kind of interim bootstrap language for implementing CPL (either “Combined Programming Language” or “Cambridge Plus London”, named for the two universities collaborating on the spec while each producing their own compiler). I can find very little detail online about the actual features of CPL. Think of it as an all-singing, all-dancing 1960s kitchen-sink programming language that would have gone up against PL/I, except with some slightly more advanced computer-science concepts behind it.
@@supernenechi Bit of yes and no. Go back to working with Windows 3 for an extended period of time; most programs were written in C. Written by programmers who thought that if a language gave you tricks it was your job as a programmer to implement as many of them as you could in as little space as they'd fit in. Then you try running multiple programs along one another. Preferably on an operating system that does not utilize a CPU's memory protection hardware.
Nowadays, the most important place where C's used is inside the Linux kernel. The way in which C is the golden standard is that other languages base their syntax heavily on C.
Then again, at least it's not Java. :P
I never got to meet John Peck but Peter Hibbard, who spent a sabbatical year with him at UBC, is a close friend. Yes, C is not in any way a language for purists but as a portable System Implementation Language it has a lot going for it.
I learnt programming with Algol68-R as an second-year undergraduate in 1976-77 (I had already written BASIC programs for some years, but not learnt to program). And I once saw an Algol68-R program that started with a lot of operator definitions, and then used the lyrics of "The twelve days of Christmas" to calculate (I think) factorial 12.
9:07 ->
That's how it's in government offices. I had a similar experience: I didn't have a right degree in order to be paid enough. My boss knew that researchers could be paid more even if they don't have a degree ... so I became a researcher.
1:40 I got hold of a copy of the ALGOL-68 spec when I started first year at Uni, and it just blew my mind. I was quite disappointed later to discover that most computer scientists considered Van Wijngaarden grammars to be just too complicated, and so they stuck to simpler, less formal, not to say cruder, ways of defining their languages.
The difficulty to wrap one's head around is that these 2-level vW grammars are capable of notating any language, as they were designed as notating tools for a Turing-complete implementation. The resolution mechanism for this was the genius of Adrian van Wijngaarten, and probably lit up the implementation efforts for the Prolog language because Colmerauer seemed to get the gist of this, and made a resolution machine based on an interpreted notation called horn clauses.
At its core, there are a series of axiomatic operations that preserve the mathematical intention of the recognized language, which is what is so brilliant about setting up the 2-level grammar.
Even though I don't develop for a living anymore, the art of parsing is still a preoccupation, and I did play with awk (Aho, Weinberger, and Kernighan) for a long while to write a parser table generator that has the ability to generate a LR(1) or LR(0) parse table if no productions in the input language resolve to an empty terminal. Part of that involves representing the item sets and transitions into a representation that happens to look a lot like an operator precedence grammar encoding the item sets. In fact, I think it is, but this is also a bloated and symbolic way to construct a parse table.
This is still being toyed with at a recreational pace, but I hope something can be useful with investigating properties of such domain transfers, because I am potentially going from a deterministic context free language (DCFL) that has a parsing table representation that is recognized as a regular expression grammar, but still preserves the origin input DCFL grammar because the elements still require a stack to keep track of nested constructs.
To remember, regular expressions don't need a stack to keep track of state, so this separates this class of languages from the next, which is the context free grammar. These classes of languages require a stack of sorts to keep track of parsing elements. Context sensitive grammars have a need to keep information across a set of relevant productions, so these need a separate structure such as a heap to glue together elements by implied intent (which is provided for in the second level) and to checklist other attributes of the language to see if an aspect is properly defined, etc. The vW-grammars also note this, so these are clearly context sensitive, but are defined in an axiomatic fashion that requires some time to work through.
I believe some of the most advanced work in this area still is in the UK and Netherlands, though I've seen lots of Indian authored videos are around for explaining parser generation methods using the same methods as in the "Dragon Book".
I'd love to hear some history on the development of algol 68, the controversies, and the features it brought to the table (if even they weren't implemented by a compiler)
i'm a simple man, i see Professor Brailsford, i click the video.
I worked at RRE and Algol68R was the first language I learnt. It ran on the station’s ICL1906F under an OS I think was called George. In those days you could write a program, get it compiled by the operators, fix the bugs and get a useful output all before lunch.
Quite likely George 3, if that was the late 70s
You truly are a treasure professor Brailsford.
It's amazing to think these people were still inventing radical things we see as fundamental today like types, pointers, and dereferencing. In 1970 you needed an outreach class from university professors working with government programmers, 50 years later you can learn it all for free online. Wonderful history.
Professor Brailsford is freakin' awesome. I'm absorbing everything he says like a digital sponge!
d i g i t a l s p o n g e
Yay, Algol68, my first programming "love". Using the Malvern compiler on Multics, early 80s.
Ahhhh BCPL, back in the day I wrote several compilers in BCPL for C, Pascal and some weird languages that I only ever saw on one computer.
There is a valid point of view in seeing COBOL data definition levels as structs; especially when there are arrays of them.
Algol-68R was my first programming language, and I am eternally grateful for that! It taught me to perfectly structure a program because there was no other way! After the normal course exercises (8 queens problems etc) I wrote a monopoly simulation which improved my game tremendously! I am guessing that the military connection is the explanation of why the documentation was only available from the H.M. Stationary office. Are there any other languages out there that allow you to define your own infix operator?
Oooh Swift lets you do that now I believe
I think R, and newer versions of C/C++ do too
No, C++ and Python do not let you define new operators, they only let you overload existing ones. ALGOL 68 did allow you to come up with new operators. But you couldn’t use non-alphabetic/numeric characters for them.
OK, but still, there is a mighty span of years between Algol68 and R. Algol68 was a gem of a language for it’s time!
I've nothing against the other guests on this channel but this legend is what made me a subscriber =)
Never really used ALGOL, but Data General's language they used for all their non-assembly OS software on the Eclipse I worked on in college used DGL..."Data General Language". We referred to it as "extruded ALGOL" :)
Sounds like they copied the idea from Burroughs.
Did my final year project using Algol 68 on an ICL1901T using Maximop 😁😁 Loved it (got a distinction 😎)
wats a distinction. r u ok
I was told to go to high school day at a local university in 1967 about. Punched cards and Algol (was there a 60). 1 day didn't teach much, but I found an Algol book at the public library. I spent months writing a program to play the solitaire card game and when I went in the next year to get 20 pages of code punched, I found it was obsoleted, and we now had teletypes to work on, rather than punched cards. Live and learn I guess.
On the BSc E & E Engineering course at Kingston (on Thames) in the mid-70s we were taught Algol 60, running on an ICL1900 that was upgraded each year. The last year I was there it was running MAXIMOP.
It's funny. I worked on manufacturing control systems, inventory control systems, and other business systems in the late '70s through early '80s. They were written in FORTRAN 66. We had access to bit shifting operations, so were able to handle character data. We were able to store pointers in long integers, and call primitives to use them. The code ran fast enough to keep the company growing. Eventually, some of the spaghetti code was converted to RAT4. Most utilities were written in PL/1 derivative languages (PLP and SPL if you know the vendor).
The Pascal Family, Delphi, Turbo etc all came from Algol W. In fact Niklaus Wirth used Algol W to create Pascal to begin with. He wanted a new language to emphasizes the orderly use of conditional and loop control structures without the need of continuous GOTO statements.
I remember spending a year coding Pascal back in 99... that shows how far behind our education system was in Australia haha ... and DBase, classic...!
Lol, I spent a year coding in Pascal in 2013.
No, no... Our state school in the US used Pascal back in '90 - '94 years for a few of the CS core classes. No regrets! Pascal is a far better CS foundational language than Java or Python, which are used in so many programs today. I don't know how graduates function without courses using assembler or at least C these days, but some programs eschew those entirely.
One point not mentioned (it was a little later than referred to here) Pascal was released to universities free of charge to math departments and the students thereof. I don't know if it was the same in England, but here in the US it was a major advantage for Pascal.
It helped that Pascal was designed to be implemented using a single pass recursive descent compiler. So with Pascal you got a great mix of an expressive language that could be implemented quickly and compiled fast. During much of the 1980s I made a lot of money as a real-time programmer using Pascal.
@@mandolinic Did you ever use Borland's Delphi?
@@johnlinley4375 No, not Delphi. I used the UCSD P-system quite extensively.
Pascal was such a (relatively) small language, there were loads of compilers available, including ones you had to pay for and ones that you got for free. ALGOL 68, on the other hand, was much larger and more complex, so in our little neck of the woods, we never saw a compiler for it.
We had some projects in my first job that some colleagues did with Borland Turbo Pascal, and in this case one of our engineers specified a GPS satellite health model that was transcribed into code.
Pascal being what it was is a language built more or less with a LL(1) grammar, which means that the first terminal in a production pretty much called out the rest of the syntax pieces for a production. Languages can still be quite elegant and the parser would be reliably one pass because the grammar was unambiguous and could be figured out by a short prefix at any time. If my understanding is right, LL(1) grammars are likely also SLR(1) because they would be easy to follow.
Fascinating from start to an important finish
Not strictly true that Pascal didn't allow bit manipulation. Every Pascal compiler implemented a SET as a sequence of bits, so you could set/clear bits by adding/removing numbers from a set. You could cast between a number's integer representation and its bit representation using a variant record. This might sound clunky to the C programmer, but in practice it meant you had to think about what you were doing and why you needed to do it!
What's your reveiw of today's Free Pascal compiler? Current version 3.2.0
I love these history videos
depends what you're calling "free Pascal". I use Lasarus because I loved Borland's Delphi.
I didn't understand a word of this but nice vid keep it up
"What happen in Nottingham, stays in Nottingham"?
I recall a huge academic bias towards Pascal in academia when I was learning to program in the late 70's and early 80's which I thought was entirely unjustified.
I had the same experience here in Sweden.
We had to learn Pascal in computer ed.
(I never did tho)....
Learn pascal, it’s great. Much better than C.
Reupload?
Is Algol 68 or for that matter any member of the Algol family of languages stil being used?
Very relaxing to listen to! I guess I am pretty young to be here, in fact I kind of feel ashamed for liking ancient languages since even C is about 25 years older than me. For some reason I thought that in the 60s Fortran was king, but it seems it wasn't :))
Fortran was king for engineering students for decades, principally because of native support for complex numbers and then subsequently the extensive numeric libraries available to Fortran programmers.
I have no Englisch words for the respect of these keyboard cowboys. Thanks for sharing
Did ALGOL allow the programmer to switch to machine-level coding where necessary?
Can't watch. No captioning. I programmed in Jovial (an Algol varient) when I worked on the Air Traffic Control Centre System for the FAA in the 1970's.
apologies. hope to have captions with Sean within next couple of days
“JOVIAL” = “Jules’ Own Version of the International Algorithmic Language”. That “International Algorithmic Language” being one of the names for ALGOL-58.
How about ELAN for educational purposes. Was that considered?
🥘 Thank You!
I'm waiting for a video on Kernel.
ALGOL variables are not to be confused with Algol variables.
Eclipsing binaries? Named for “al-gul”, aka “the demon”.
At 9:00 the contribution of Joan Clark to the computer science is mentioned. I really wonder how many women took part on the Computerphile RUclips channel.
All the cuts and inserts are a bit too much in this video.
Love your bernaise and lasagna boxes!
If only ALGOL 68 was released one year later...
xd
those wood pigeons are going crazy
Ada rules them all!
Is that a secret tunnel through the trees at the back there, left of the screen?
ARPAnet account #300 waves, shouts Hi, and sends lots of bangs: !!!!! Please separate them before use.
Nice to be early,
Fun fact: If you turn off a computer , it won’t work until you turn it on
Y on earth is there 1 dislike after 30 mins
That kid never liked to C
If they go, Algol
BCPL fans...lol
Brailsford ftw
Hmm
First
grandpa telling war storries
For goodness' sake man, get a tripod (or at least a steadycam or post-stabilization or something)! I'm getting motion sickness within the first few seconds. You're not an avant garde filmmaker.
Isn't he? Avantgarde of Computer videos.
Either get a tripod or a gyro. That video is unwatchable.
Nobody uses those languages anymore, so your video is irrelevant. BTW, way back then, everyone I knew used Fortran - nobody (and I mean nobody!) used Algol. Fortran was for REAL computations - maybe Algol and Pascal were for games or light-weight computations??
The original pascal doesn't exist anymore, but it is still alive and very well through FPC. And I agree with you, FORTRAN (all capitalized at that time) was incredibly wide used.
games are running on cutting edge tech and is a billion dollar industry nowadays.
Reupload?