Grep and Grok's Adventures in Semantics

Grep is not wrong. Grok is not magic. Exactness and context keep each other honest.

Characters

Meet the Characters

Grep and Grok are both useful. The comedy starts when either one is asked to do the other's job.

Grep

Grep excells at exact matches, long searches, and can always be relied on when asked if a string is there or not. But ask Grep the difference between 'duck' and 'duck!' and all you will hear is 'one has an exclamation point.

Grok

Grok looks at the situation, notices the surrounding cues, and gets the point immediately. But give Grok complicated rules to follow and you will get a lot of mistakes

First four cartoons

Four small accidents between exactness and context

Four-panel Grep and Grok cartoon about copy editing and find-and-replace.
Grep
Matches every instance.
Grok
Checks quotation, idiom, tone, and meaning.

Find-and-replace has a productive morning.

Four-panel Grep and Grok cartoon about counting the word significant in a report.
Grep
Counts the word significant.
Grok
Asks about sample size, effect size, and interval.

The word felt significant.

Four-panel Grep and Grok cartoon about reading a hot dog sign as if it meant a dog.
Grep
Reads the visible word.
Grok
Reads the scene around the word.

Text in image is not image understanding.

Four-panel Grep and Grok cartoon about rating a horror movie by counting sentiment words.
Grep
Counts sentiment keywords.
Grok
Checks genre, tone, and reviewer expectation.

Keyword sentiment met genre.

The point of the series is to make a distinction that is easy to miss. Pattern matching is not the same as string matching, and neither one replaces the other.

Grep stands for exact symbolic matching: strings, labels, words, counts, and rules. Grok stands for richer semantics: context, situation, parallel cues, and getting the point of what is going on.

Grok needs Grep when exactness matters at scale. Grep needs Grok when exactness alone misses the situation.

Process

How The Images Are Made

The working process for turning a Grep and Grok idea into a generated cartoon and an archive record.

Read the process notes