The only thing the shell is good at is gluing together other utilities.
Have you seen people embarrassed they're writing shell scripts instead of doing "real programming"? I haven't.
People keep misunderstanding what I am and am not saying, so, clarifications:
This is not about GNU Bash or any specific shell implementation, this is about Unix shells in general
Shell's intended for gluing other programs together, and is very good at it
@sir if you're saying that they have a different purpose, you're right — but that doesn't change the fact that shell is being used as a scripting language oh so often, and it's terrible at it.
@bugaevc it's not bad at what it's designed to do: manipulate text, and pass text to and from different programs. Maybe with a little bit of logic mixed in.
@bugaevc really I don't know of anything better than shell scripts for that purpose
@sir that's my issue though: whenever I want to glue some programs together I reach for shell scripting; but then I discover I need sane types like lists and maps and sets and lists of lists, so I switch to Python, but then it's awkward to shell out to those other programs.
Why oh why isn't shell a better programming language :(
@bugaevc you could always mix in a little bit of awk. awk is underutilized imo
And honestly, it's not like being a Lisp is a good thing (unless it's Emacs Lisp 😉).
I know about shell's relation to ALGOL; but that doesn't make the syntax any nicer.
@kick @sir Could you expand on your claims that GNU Bash is not POSIX compliant? I believe it tries to be, especially if you run it as /bin/sh. And why do you believe that it's specifically extensions over what POSIX requires that slow "non-compliant" shells down? In any case, I was specifically not referring to any particular shell, so pick whichever one you think is most compliant/performant.
i don't actually think i know anyone who thinks of shell as a _good programming language_ as such. a good tool along certain dimensions, sure, but not a good general purpose language.
shell definitely partakes of the turing tarpit thing, though. i think people aren't so much embarrassed or not about large shell scripts as they're either stuck with something that started small or unable to help themselves wrt the challenge.
What? They're for different things. One is for system automation. The other is for showing drop-down menus on the websites.
@bugaevc in this world where every developer is lamenting about something I was looking for a soulmate that thinks like me that is terrible to write programs in bash. I feel less lonely today.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!