why is the shell the way it is
Sketchy notes on the question: Why’s it so much easier to invoke shell commands for given chunks of functionality than to do equivalent things in most languages? Why/how does the shell offer so much in the way of repeatable, low-ceremony, stable-interface invocation of things you deal with a library for in other contexts?
This might be notes towards a larger “Considering how terrible the Unix shell is, why is it so good?”
Shell commands are self-contained: You expect to be able to invoke them as one-shots.
Users keep the API at least partly in their heads (and histories, and hacky scripts with no formal versioning on either side of the interface), so there’s evolutionary pressure towards stability.
- edd mentioned BSD vs. GNU, and fair enough, but the amount that questions like that impinge on my practical use of the shell pales compared to what users of most contemporary languages can expect from both libraries and language revisions. Has Bash ever subjected me to an experience like migrating code from Python 2 to 3? Indeed it has not.
In the shell, you operate on/with shared primitives: Text streams, files, processes, environment variables.
From the user’s perspective, a shell command tends to exist everywhere on the system. You’re drawing from a global vocabulary.
earthtopus:
the power to smash together your own horrfying scripts from very simple elements is part of the charm
It is, I agree, a whole lot of the ballgame.
(Thinking about this after a fediverse thread. Plenty else to pull in if I’m going to turn this into an essay, and some folks to credit.)