I spent an hour or two hacking on this today. It’s a teeny strings clone written in less than a hundred lines of Zig. When compiled in ReleaseSmall mode on Void, the binary comes out at 22.6 KB, while GNU strings on my machine is 38.7 KB. This version isn’t as fully-featured, yet, but it was super fun to write.
I want to eventually make it support Unicode, but couldn’t figure out how to wrangle std.unicode into submission.
I searched for “teeny strings” and got adverts for “Teen string bikinis”. I’m not going further down that rabbit hole, so could you give a bit more context. I was expecting a small string library, but it appears to be a CLI tool, so I’m lost.
strings is a cli that prints all ascii strings in a file. It can do things like finding constants embedded in a binary.
From man strings
DESCRIPTION
For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the
options below) and are followed by an unprintable character.
Depending upon how the strings program was configured it will default to either displaying all the printable sequences that it can find in each
file, or only those sequences that are in loadable, initialized data sections. If the file type is unrecognizable, or if strings is reading
from stdin then it will always display all of the printable sequences that it can find.
strings is mainly useful for determining the contents of non-text files.
Let me say it like this: it’s like naming a file explorer “File Explorer”.
Sure, you know just from the name what it is, but that doesn’t mean that it’s a good name for a particular piece of software. It’s a software category. Nobody names a car “Car” either.
Plenty of software is guilty of this, see also Voice Recorder, calculator, calendar, messages, contacts, etc. Personally speaking, I’ll take a boring name over something poetic that I need a readme to remember what it does, but I also have fun coming up with cute names for software sometimes so I get both sides
Car is a generic category, like Unix tools is a category. strings is a program in the Unix tools category. The name is decently detailed and discoverable. You want it to do what it says on the tin.
I’d rather have a boring name, especially for default utilities. For alternatives or specialized program, a unique name can be useful.
I’m fairly confident strings is named in the same vein as other common Unix utilities which are commonly (and purposefully) named in a clear, unimaginative fashion. Just a few similar examples:
ls
find
head
tail
less
mkdir
mv
cp
locate
touch
From that perspective, I think strings fits in well.