6 ms·
“A damn stupid thing to do” – The origins of CPL, BCPL, and C (2020)
- aap_ 4y agoI couldn't think of a worse clickbait title than this. The quote has nothing to do with C.
- observer4 4y agoLOL. That's right. Well observed. Just the "origins of C" would be a lot more honest. I also liked the commentary on theory and practice, which could have something to do with C and UNIX and the whole story.
- karmakaze 4y agoThe quote seems to apply to the origins of C upon reading. > One minor quibble was Strachey’s objection to the grammar of “IF … THEN … ELSE” statements. “I cannot allow my name to be associated with a definite recommendation to use ignorantly incorrect English,” was his view, as Hartley later wrote for Annals of the History of Computing. Strachey preferred “OR,” which conflicted with the way “OR” was used in nearly every other programming language in existence. Nonetheless, his preferences carried the day, and the CPL reference manual included “OR” in the place where users would have expected “ELSE.” That seems like a pretty stupid thing to do--perhaps not at the time by the 'do'ers.
- aap_ 4y agoSure, somebody admitted to doing something stupid, but the title is clearly meant to attract all the C bashers by pretending the quote is from someone who was involved in the development of C.
- captainmuon 4y agoMaybe language changed since then, but to me 'else' sounds right and 'or' sounds wrong: IF (condition) THEN (do-this) ELSE (do-that). I think 'or' would not go with alternative commands, but with an alternative condition: IF (condition) THEN (do-this) OR (other-condition) THEN (do-that). If you don't want to use 'else' then 'otherwise' would sound idiomatic, too.
- smcl 4y agoRemember that there’s already two commonly used elements of logic and programming (bitwise OR, logical OR) that may well form part of condition/other-condition, so while if/then/or may (subjectively) scan a little better in isolation, I think “else” might have been the right call
- cesaref 4y agoI don't remember this in BCPL, so I presume it was one of the changes from CPL?
- xnorswap 4y agoI hadn't thought about it before, but I'd have gone with: > IF THEN OTHERWISE Which avoids overloading OR and maintains better grammar. But I suspect shorter words were preferable when space was a premium everywhere not least on the display itself.
- Y_Y 4y agoWHEREUPON x PURSUANT y CONTRARIWISE z
- irrational 4y agoWherefore art thou utilizing contrarwise? Dost thy senses leave thee?
- Smaug123 4y agotwitch "Utilize" first arose in 1807 if Merriam-Webster is to be believed, well past the period you're quoting; and "dost" should agree with the number of its noun "senses". ("dost" is second-person, but you need something third-person.) In this context I also don't really like the continuous present of "are you utilizing", but I can't put words to why. I believe "hast thou taken leave of thy senses" is actually recorded to be idiomatic. By the way, ChatGPT suggests (where I've fixed its analogous error in the word "doth"): > Pray tell, wherefore dost thou employ the term 'contrariwise'?
- matheusmoreira 4y agoI remember saving this code from somewhere. #include <stdio.h> #define PREACH printf #define SHOULD_GOD_WILL if #define EACH_AND_EVERY_CREATURE_UNDER_GODS_LIGHT for #define OTHERWISE else #define RETRIBUTE return #define ALONG_WITH && #define THUS } #define LET { int main() LET EACH_AND_EVERY_CREATURE_UNDER_GODS_LIGHT (int i = 0; i < 100; i++) LET SHOULD_GOD_WILL (i % 5 == 0 ALONG_WITH i % 3 == 0) LET PREACH("Fizzbuzz!\n"); THUS OTHERWISE SHOULD_GOD_WILL (i % 5 == 0) LET PREACH("Buzz!\n"); THUS OTHERWISE SHOULD_GOD_WILL (i % 3 == 0) LET PREACH("Fizz!\n"); THUS OTHERWISE PREACH("%d\n", i); THUS RETRIBUTE 0; THUS
- GTP 4y agoAccording to the article, the stupid thing was developing a new language just because you built a new computer. But the efforts in developing this new language (CPL) are what lead to C.
- fanf2 4y agoThere is a neat history of the early syntax of conditional expressions here https://github.com/e-n-f/if-then-else/blob/master/if-then-else.md https://github.com/e-n-f/if-then-else/blob/master/if-then-el... titled “if-then-else had to be invented”. It seems “else” originated in Algol 60 as a hasty translation from German. The CPL project started in the early 1960s when it was not yet certain that Algol-style block structure and keywords would become the common basis of most programming languages.
- dang 4y agoThe article does talk a lot about the origins of C, so it's fair for that to be in the title. We can make it more accurate by throwing in CPL and BCPL too.
- rramadass 4y agoAgreed. The title is garbage (Ars should know better). But the article is a good History of C and worth a read.
- up2isomorphism 4y agoBeing humble is good for popularity sometimes.
- philbo 4y agoI'm sure Strachey was a decent bloke in person but this bit gave me some unpleasant flashbacks to certain former colleagues: > Almost immediately, they had some difficulty prioritizing, as David Barron noted of Strachey, “It was characteristic of him to insist on minor points of difference with the same force that he insisted on major points.”
- vidanay 4y agoIt's amazing that some people never learn that "choose your battles" is more than just a cliche saying.
- ngcc_hk 4y agoGot whole Althusser who copied from mao which got china. United Front (which fund Confucius college) is still an approach. I hate them and communist in general, but please war of position or war based on position is key to the dark side winning. For the china example, Mao has instructed and except one disobedient general never fought the war against japan. And said thank you then of invading china afterward. Back to this I posted. I think that early pioneer many of these have issue of fighting all or select whatever he thought important. That is why they did this in the first place I think. Some ok some not. And you hope the idea or company spread around enough (mouse-windows to Steve) that someone did it and fight the right strategy war. Free source to open source is another example.
- microsoftdoes 4y agoIt’s better to not be an asshole. But it’s mostly okay to be an asshole too. The world needs more than just ultra-agreeable people. I reckon grudge-holding is way more destructive to teams than abrasiveness. There’s lots to be said in favor of the asshole who moves past a conflict as soon as it’s over.
- JamesSwift 4y agoIts unnecessary conflict. If everything is the same level of disagreement, what are you _actually_ arguing and what do you just _happen_ to be arguing? You give the other party no capacity to gauge your actual level of interest. It makes the entire process that much harder for everyone and wastes the "argument budget" on ultimately meaningless stuff. Its a very similar idea to being "penny wise, pound foolish".
- methods21 4y agoTuring suggested that, as a first step, he write a program that would enable the Ferranti Mark I to simulate itself....The trace program Strachey wrote included over a thousand instructions—at the time it was the longest program that had ever been written for the Ferranti Mark I. Strachey had it up and running after pulling an all-nighter, and when the program terminated, it played “God Save the King” How many 'computer programmers' could do this in today's world?
- bigbillheck 4y ago> How many 'computer programmers' could do this in today's world? They're numbered in the thousands.
- smallest-number 4y ago> Strachey had always displayed a talent for the sciences but rarely applied himself. I would guess any experienced programmer with adhd would and has done the same multiple times.
- dang 4y agoDiscussed at the time (of the article): “A damn stupid thing to do”–the origins of C - https://news.ycombinator.com/item?id=25400486 https://news.ycombinator.com/item?id=25400486 - Dec 2020 (20 comments) “A damn stupid thing to do”–the origins of C - https://news.ycombinator.com/item?id=25357867 https://news.ycombinator.com/item?id=25357867 - Dec 2020 (5 comments)
- an1sotropy 4y agoOn reading that C has "BCPL semantics with a lot of SMALGOL syntx" , I was really curious to see some examples of SMALGOL programs. I found this [1] which describes what is taken out of ALGOL to make SMALGOL, and searches for "example ALGOL programs" work ok. But how can I see some non-trivial SMALGOL programs? [1] https://dl.acm.org/doi/pdf/10.1145/366813.366843 https://dl.acm.org/doi/pdf/10.1145/366813.366843
- anthk 4y agoOn C, compilers in the 90's sucked up a bit, and the code wasn't much better. Consider this: https://github.com/gwf/CBofN https://github.com/gwf/CBofN This code crashed CWM under OpenBSD 7.2, but it worked under FVWM. And, still, the fractal generating time was atrocious. I could reimplement the figures in PostScript and yet render them faster under GhostScript than the C binaries against Xlib.
- musicale 4y ago> Like Unix, C was a success born of failure. In both instances, programmers took the best parts of projects that were doomed because they sought to do too much. Multics, which spawned Unix, was—at its peak—only used on about 80 computers worldwide, and CPL, which ultimately led to C, was abandoned by Cambridge researchers in 1967 without being completed. Unfortunately for C and Unix, it turned out that features like memory safety (PL/I) and ring security/ACLs/MAC (Multics) were actually good ideas. Of course memory-safe C/C++ compilers/ABIs/runtimes are possible and seem like a very good idea - certainly if you have the hardware (CHERI) or are willing to take a performance hit (probably acceptable considering that computers are fast enough to run apps in JavaScript/Python/Java/etc..) Unfortunately Linux inherited Unix's security architecture and we've ended up with a hodgepodge of stuff like SELinux, AppArmor, hypervisors, containers, gVisor, etc. to try to fix it. And of course it usually runs on vulnerable hardware which has prioritized speed over security.
- cryptonector 4y ago> Unfortunately for C and Unix, it turned out that features like memory safety (PL/I) and ring security/ACLs/MAC (Multics) were actually good ideas. Yeah, but perhaps the real misfortune was how small the obsolete PDP-10s that DMR, BWK, Ken Thompson, et. al. were working with.