Borden via Bug reports for GNU grep <[email protected]> writes:
> 8 Jul 2026, 04:31 by [email protected]:
>
>> Yes, but tr does not use regular expressions so its man page can't delegate
>> to regexp(7) as easily as
>> grep's can.
>>
> That's exactly my point. If it looks like a regular expression and
> matches like a regular expression, surely you can forgive me for
> thinking it's a regular expression. This is also how every
> conversation with a chatbot goes:
I would hope any LLM would warn you that 'tr' does not take regular
expressions as arguments. The POSIX manual [1] and GNU coreutils info
pages [2] warn about it, because it is a common point of confusion. LLMs
are certainly trained on both of those pages, and many other occurrences
of that topic coming up [3].
I agree with Paul that adding a reference to regexp(7) would cause more
problems than it solves. Unless we surrounded it in large warnings,
which would defeat the point anyways. :)
>> Sometimes I wish I could go back to Bell Labs circa 1975 and whisper
>> into the Unix developers' ears, "Simplify the utilities' API!"
>>
> I'm starting to think that every programming language should face
> mandatory retirement after 20 years. Every language I've learnt has
> become more duct tape retrofits than language: C++, Java, JavaScript
> and PHP (since always). Even the favourite child Python has turned The
> Zen of Python into a sardonic joke.
>
> (I'm obviously not serious. You don't need to remind me that COBOL
> runs the global financial backbone)
It would make better programming languages, sure.
However, for all it's faults C programs tend to work for decades. The
first version of Redis from 2009 compiles on my modern system just fine:
$ uname -a
Linux fedora 7.0.14-201.fc44.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 1
13:34:38 UTC 2026 x86_64 GNU/Linux
$ ./redis-server; { make CC='gcc -std=gnu89'; ./redis-server; } >/dev/null
2>&1 &
bash: ./redis-server: No such file or directory
[1] 252320
./redis-server; { make CC='gcc -std=gnu89'; ./redis-server; } >/dev/null
2>&1 &
bash: ./redis-server: No such file or directory
[1] 259754
$ printf 'PING\r\n' | nc localhost 6379
+PONG
The same can't be said for most modern languages.
Collin
[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tr.html
[2]
https://www.gnu.org/software/coreutils/manual/html_node/Character-arrays.html
[3] https://lists.gnu.org/archive/html/coreutils/2026-01/msg00032.html