HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Where GREP Came From - Computerphile

Computerphile · Youtube · 272 HN points · 9 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Computerphile's video "Where GREP Came From - Computerphile".
Youtube Summary
Commonly used grep was written overnight, but why and how did it get its name? Professor Brian Kernighan explains.

EXTRA BITS: https://youtu.be/bSaBe6WiC2s

Inside an ALT Coin Mining Operation: COMING SOON
Unix Pipeline: https://youtu.be/bKzonnwoR2I

https://www.facebook.com/computerphile
https://twitter.com/computer_phile

This video was filmed and edited by Sean Riley.

Computer Science at the University of Nottingham: https://bit.ly/nottscomputer

Computerphile is a sister project to Brady Haran's Numberphile. More at http://www.bradyharan.com
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Yes, Brian Kernighan said it's pronounced "ee-dee": https://www.youtube.com/watch?v=NTfOnGZUZDk
seanhunter
...and that never made any sense to me. Because you don't pronounce "sed" as "ess-ee-dee". So if you pronounce "sed" as "said", you must surely pronounce "ed" as "ed".
kps
The reason is that it's a descendant of QED — https://en.wikipedia.org/wiki/QED_(text_editor)
Dec 08, 2021 · 3 points, 0 comments · submitted by peterbe
Dec 03, 2021 · 4 points, 1 comments · submitted by keyle
delgaudm
Previously: https://news.ycombinator.com/item?id=17478260
My favourite BWK video is about grep. https://www.youtube.com/watch?v=NTfOnGZUZDk?t=566

The last part is very quotable: "They had one grave disadvantage, none of them were Ken Thompson"

Slightly off-topic, but Brian Kernighan has a great video about the origins of grep. If you know anything similar for awk, I'd enjoy watching it!

https://www.youtube.com/watch?v=NTfOnGZUZDk

yesenadam
There are some SNOBOL books on archive.org I had a look at not long ago, including a detailed manual/tutorial - fascinating, takes you back to <1970. It seems to have been widely used from the mid 60s on, predating the "Unix Epoch". It's pretty cool and Awk resembles it in many ways. The manual starts with many pages telling you how to load all the tapes for the program in correct order!

"It was one of a number of text-string-oriented languages developed during the 1950s and 1960s; others included COMIT and TRAC.

SNOBOL4 stands apart from most programming languages of its era by having patterns as a first-class data type (i.e. a data type whose values can be manipulated in all ways permitted to any other data type in the programming language) and by providing operators for pattern concatenation and alternation. SNOBOL4 patterns are a type of object and admit various manipulations, much like later object-oriented languages such as JavaScript whose patterns are known as regular expressions. In addition SNOBOL4 strings generated during execution can be treated as programs and either interpreted or compiled and executed (as in the eval function of other languages).

SNOBOL4 was quite widely taught in larger US universities in the late 1960s and early 1970s and was widely used in the 1970s and 1980s as a text manipulation language in the humanities. ...

SNOBOL4 supports a number of built-in data types, such as integers and limited precision real numbers, strings, patterns, arrays, and tables (associative arrays), and also allows the programmer to define additional data types and new functions. SNOBOL4's programmer-defined data type facility was advanced at the time—it is similar to the records of the earlier COBOL and the later Pascal programming languages.

All SNOBOL command lines are of the form

    label subject pattern = object : transfer
Each of the five elements is optional. In general, the subject is matched against the pattern. If the object is present, any matched portion is replaced by the object via rules for replacement. The transfer can be an absolute branch or a conditional branch dependent upon the success or failure of the subject evaluation, the pattern evaluation, the pattern match, the object evaluation or the final assignment. It can also be a transfer to code created and compiled by the program itself during a run.

A SNOBOL pattern can be very simple or extremely complex. A simple pattern is just a text string (e.g. "ABCD"), but a complex pattern may be a large structure describing, for example, the complete grammar of a computer language. It is possible to implement a language interpreter in SNOBOL almost directly from a Backus–Naur form expression of it, with few changes. Creating a macro assembler and an interpreter for a completely theoretical piece of hardware could take as little as a few hundred lines, with a new instruction being added with a single line."

https://en.wikipedia.org/wiki/SNOBOL

1vuio0pswjnm7
SNOBOL was the first to use so-called "associative arrays". In SNOBOL, we call them "tables".
ok this one yes

https://www.youtube.com/watch?v=NTfOnGZUZDk

so, does it make me incorrect in general idea?

what about ls? echo?

vcxy
It happens that the p in pwd actually does historically mean print from multics, but honestly I just do not care about that, let the p mean whatever you want. My inner monologue will always be "present working directory" even though I think that option is totally silly, my brain is stuck with it now.

I just thought I was offering an interesting fact about where "grep" comes from.

Sep 23, 2020 · 2 points, 0 comments · submitted by tosh
Computerphile did a great video with Brian Kernighan on "Where GREP Came From"

https://www.youtube.com/watch?v=NTfOnGZUZDk

"Where GREP Came From" by Brian Kernighan from Computerphile:

* https://www.youtube.com/watch?v=NTfOnGZUZDk

For those unfamiliar, Kernighan is the "K" in K&R C and the "K" in AWK:

* https://en.wikipedia.org/wiki/Brian_Kernighan

jcims
Great interview with Brian on Lex Fridman's podcast - https://www.youtube.com/watch?v=O9upVbGSBFo
mercer
I listened to that one last night, and then a few more. He's been in rotation for a while now.

I don't know how I ended up subscribing to Lex Fridman's podcast, but it's both wonderful and somewhat bizarre to me.

On the one hand, he comes across as the kind of character you'd expect in a horror film. Meticulous, well-dressed, friendly, but affectless in his speech and oddly emotionless and formal.

But then the actual questions he asks, and the observations he makes, are IMO a step above most interviewers. I can think of a number of 'greater' interviewers, but he's definitely well in the 'very good' range.

My apologies if Fridman reads this comment. I definitely don't want you to stop doing things the way you do :). It's just somewhat different, in a strangely 'boring' way, that I'm not used to from most good podcast hosts that I'm familiar with. Most are, sometimes to the point of irritation, exceedingly affable and chatty.

throw0101a
> On the one hand, he comes across as the kind of character you'd expect in a horror film. Meticulous, well-dressed, friendly, but affectless in his speech and oddly emotionless and formal.

Are you aware of the The Report Of The Week channel run by 'Review Brah'?

* https://www.youtube.com/user/TheReportOfTheWeek

Jun 18, 2020 · 2 points, 1 comments · submitted by evolve2k
evolve2k
I found it amusing when he explained how the Editor of the day was pronounced “E D” rather than “Ed” which would in my mind make more sense as short for Editor.

I’m sure history is littered with this little micro sticking points.

Jun 05, 2019 · 2 points, 0 comments · submitted by lordnacho
Aug 02, 2018 · 1 points, 0 comments · submitted by algui91
Fun fact: this problem is why grep was created by Ken Thompson [1].

[1] https://youtu.be/NTfOnGZUZDk

neonate
That was on HN yesterday. https://news.ycombinator.com/item?id=17478260
berti
Neat! Kernighan really is pleasant listening as noted on that post.
Jul 07, 2018 · 250 points, 59 comments · submitted by signa11
ahurmazda
I hope these videos will live on for many years to come. Absolutely amazing and rich oral history of many things we take for granted in our daily lives.
Waterluvian
I could listen to Prof. Brailsford tell stories for ages. Oral tradition really gives these stories character and context.
mattl
Me too. I’m in a couple of them and a lot of people have told me they found them enjoyable and learned more about free software as a result.
curiousgal
>many things we take for granted in our daily lives.

The entitlement we live in nowadays vis à vis technology continues to blow my mind, from some condescending attitudes towards free software that forms the building block of a myriad of products to the "disappointment" some consumers express when a new released chip isn't twice as fast as the old iteration. There's a lot going on behind the scene and even by saying so I am underestimating just how much our civilisation has put in effort into the things that we use on a daily basis and pay to attention to.

User23
This is why I get mad when people piss on RMS. No need to dwell on his defects, he has served our community immeasurably.
krapp
If you're talking about people making fun of his weight or appearance or other strange behaviors, then I agree.

But RMS didn't descend from Mount Sinai with the Four Freedoms carved into stone by the finger of God or anything. He's just a man with an opinion, and his ideas are not above criticism regardless of what he's done for the community.

mattl
No. But he did live in a community of sharing that was destroyed by proprietary software and he has spent 45 years developing free software. So many should pay his ideas more respect than they do because they like to make it about his person life.
type0
> But he did live in a community of sharing that was destroyed by proprietary software ...

Outside software industry and computer enthusiasts no one has even heard of RMS. As for Gatesian Basic conundrum [0] of the past he could as well been forgotten if not for emergence of Linux, maybe he should be lucky be called the father of open source although I understand that he considers it to be an insult.

The common Windows10 user might be okay in having no control over their computing and merely licencing their OS [1], but I would argue that's because they don't comprehend what they're agreeing on. It's sad that computer literacy is that astonishingly low. Agreeing to some entity to have the ultimate power of your computing environment is like having to agree to someone else to have the power over the fabric of your though processes. We're still in the digital middle ages, feudal society where MS, FB, Google have the final say in the spheres of their domination exactly like the churches or kings would decide over their people.

[0]. https://en.wikipedia.org/wiki/Open_Letter_to_Hobbyists [1]. https://www.microsoft.com/en-us/Useterms/Retail/Windows/10/U...

User23
Wholeheartedly agree!

This entire thing we have going wouldn't be possible without the GNU project. And GNU would never have happened without RMS. The man is a giant. A giant with huge glaring flaws, but every single one of us that did anything with unix-like OSes in the past 30 years owes the man.

Sadly I fear that much like Peirce, Stallman will be forgotten by history because of the acumen of his primary detractors.

bkul_
I doubt Stallman will be forgotten, but I'm worried he'll be remembered more as a Cassandra than a great contributor.
ezequiel-garzon
Wouldn’t the BSDs have happened sooner or later without GNU, and without Linus? I’m grateful for the contributions of both men (who by the way have expressed quite different ideological stances), but I still think it’s an interesting question.

Edit: grammar.

mattl
Maybe yes. But BSD was encumbered by the AT&T nonsense for approximately a third of the free software community’s history. That’s a long time to sit around and do nothing.
type0
Great remark at the end: "they had one great disadvantage: none of them were Ken Thompson"

Aside from retrocomputing is there any actual use for ed in this day and age though? https://sanctum.geek.nz/arabesque/actually-using-ed/

FfejL
In a sense, yes. 'sed' is basically 'ed' for streams. Not exactly the same syntax & commands, but very very close.
eltoozero
Wait, that’s Brian Kernighan?

The K in K&R C Programming???

Mind blown, what an excellent dude!

jedimastert
He actually has a lot of really awesome oral history/lecture videos on that same channel. He's an incredible "casual oral history" storyteller.
dorfsmay
If ed looked familiar is because you use a derivative of it in vim, in ex-mode. You can also run ex standalone, which is great to automate file changes.

https://en.wikipedia.org/wiki/Ex_(text_editor)

wglb
It looks familiar to me because I wrote a tutorial for it for Coherent and used it for many years before David Conroy wrote MicroEmacs.

vim, not so much.

sedachv
The Coherent documentation is tops: http://www.nesssoftware.com/home/mwc/manual.php

Really impressive what the people at MWC did with an 8088.

sverige
Well, if you went down the emacs path in 1985 when MicroEmacs was released (near as I can tell anyway), that was six years before vim was released, so I think you meant to say "vi," not "vim."

Some of us still use plain old vi and not vim, which is why I'm a little touchy about it, I guess. (I mean, what do you need with all those damn plugins, anyway? Might as well use emacs in that case.)

dorfsmay
I moved from vi and vi clones to vim for its Unicode support, but then started learning all its more advanced operations and have been enjoying them since then.
srtjstjsj
Ed is the standard text editor, so it ought to be familiar.

https://www.gnu.org/fun/jokes/ed-msg.html

monkeywork
I wonder how his students did at the assignment he mentioned at the end :)
sverhagen
I can only imagine the learning opportunities just from comparing their results with the real grep. The original being built on an 8-bit 32kb RAM nothing little environment is not something many people are naturally inclined to optimize for anymore. And for people to even implement any kind of non-trivial spec, in this case presented as another working application, I imagine every result was different, and incompatible.
greenyoda
> The original being built on an 8-bit 32kb RAM

Actually, the PDP/11 was a 16-bit machine.

hnarayanan
Such an excellent story teller!
topicseed
I love his videos on Computerphile! Incredible source of hardcore computing knowledge.
Bromskloss
The small step from ed to regular expressions seems like a giant leap in sophistication to me.
sverige
Yes, that innovation gets passed over rather quickly, doesn't it?
MetaDark
Well Ken Thompson didn't actually invent the idea of regular expressions, but he was probably one of the first people to implement them in software. Regular languages and expressions were first formalized in 1951 by Stephen Kleene and I assume Ken Thompson used this research to implement them.
bch
I was most excited to learn that ed(1) is pronounced “eee dee”.
User23
Stands to reason really. cd, ls, mv (crush the “move” heresy), ld, and others. Ambiguity creeps in at three characters. Who’s the man?
yjftsjthsd-h
Those lack the vowels to be pronounceable. Also ed looks like the first syllable of editor and could reasonable be pronounced as such.
srtjstjsj
"ed" (and the ED in QED)'s name was also chosen as an abbreviation for "editor". But the creators chose to pronounce the abbreviation differently.
mturmon
The octal dumper od is pronounced oh-dee, the assembler is ay-ess, the archiver is ay-arr. OTOH, the delayed execution command is “at”, but that is a full word anyway.
User23
You're not wrong, but it's still pretty clear that the PDP11 crew thought in keystrokes and not syllables.
jmts
From the video [1]:

"The UNIX text editor was called 'eee-dee' - it's not pronounced 'ed', at least by those in the know - it's pronounced 'eee-dee'. This was written by Ken Thompson, and I think it was basically a stripped down version of an editor called QED"

[1] https://youtu.be/NTfOnGZUZDk?t=113

superflyguy
... by literally four people.
cat199
... who literally created it.
andremat
... please repeat after me: gif.
mattl
I generally go with “GIF with a soft G is the format, GIF with a hard G is the culture.”
kevin_thibedeau
Everyone involved in the creation of GIF and CompuShow pronounce it as "jif". Anything else is sacrelige.
ts4z
CompuServe.
kevin_thibedeau
CompuShow was the DOS GIF viewer.
ts4z
D’oh. Thanks.
mattl
Those people aren’t part of the lifestyle or culture. I wish they were.
Bromskloss
What's right is right, even if the majority is wrong. No argumentum ad populum here! :-)
lprd
I had no idea grep was made over night! Thoroughly enjoyed the video and subbed to the YouTube channel. Thanks for sharing!
dws
Extracted from working code overnight, which in those days on that equipment was still quite an accomplishment.
usermac
https://youtu.be/NTfOnGZUZDk?t=505 to jump to it and did you notice... is he wearing a Casio watch from that same time period?
bariswheel
I went down the rabbit hole hard on this YouTube channel, great content.
smadge
Kernighan saved the most interesting fact for his last comment: both grep and ed were written in assembly, not C!
jedimastert
I actually didn't know that either! I wonder if grep & ed actually predate C...It's also very possible that K&R might have thought about C as a toy or novelty at the time.
cartercole
I named my whole company after grep: grepwords.com and I had never knew this... cool history to learn
None
None
textmode
tl;dr The idea for grep, like sed, began in the mind of Lee McMahon. The program grep was implemented by Thompson. I recall reading that the program sed was first implemented by Ritchie, and later McMahon himself. Is this correct?
webbrahmin
I watched this video today and here it is on Hacker News. What a coincidence.
amorousf00p
Kernighan is so nice to listen to compared to some of the the hot air balloons in software today. I use awk everywhere (and have for many years) and am deeply indebted to BK and AR for their work on and custody of that language.
sverige
He speaks as clearly as he writes. We need more of that, everywhere.
fjarlq
AR = Arnold Robbins, http://www.skeeve.com/
Jul 06, 2018 · 2 points, 0 comments · submitted by tambourine_man
Jul 06, 2018 · 6 points, 1 comments · submitted by pdkl95
AdmiralAsshat
So grep exists because someone wanted to do textual analysis on the Federalist papers.
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.