Sure. The argument is that it's a lot easier for the user of the program to read an error message that says "jq is required. Run apt-get install jq or homebrew install jq" than to fuck around with the python or ruby ecosystem, especially if they don't work in those languages.
> Finally there are differences in how `/bin/sh` will interpret things (which there shouldn't be) depending upon underlying shell is running ksh, zsh, bash, dash
Do you have an example of code that is written to the POSIX standard of shell that runs differently? I only write POSIX shell, and use https://github.com/koalaman/shellcheck to verify that to prevent that exact thing.
There are differences between versions. I can't even remember what they are off the top of my head like I used to, which makes them all the more aggravating to discover again.
But I would recommend sticking to a subset of bash, not any of the new fancy features like 'globstar' which allows recursively globbing.
There are tools to manage these kinds of tests, like bashenv. But you're in the same problem scope at that point.
[1] Well, it has $@, which you can use as a general-purpose array with some hacks[2], but that's no way to live.
But even the nicest shell doesn't solve the dependency problem like statically compiled programs. If I could take my currently running Python code and produce some artifact that would run with nothing other than the python binary I think we'd be in a much better place.
Ohh apparently all I've needed in my life is zipapps.
One drawback is that if you want your Bash script to work on macOS, you need to restrict yourself to features that exist on version 3.2 (from 2006) because that's the latest version that will ever be included on macOS by default.
> If I could take my currently running Python code and produce some artifact that would run with nothing other than the python binary I think we'd be in a much better place.
See my other comment: https://news.ycombinator.com/item?id=23338316
Let me put it like this: I'm a programmer. I don't mind making programming a bit harder for myself if it means that I get to avoid a lot of the non-programing minutia that's part of a modern interpreted environment.
Also, if you're willing to take a dependency on jq, the issue goes away completely.
There is the question of the dependencies of a shell script, but I find in practice just checking for deps like `curl` at the beginning leads to be a better user experience. It's unlikely that there is going to be a ton of tools you require, and the tools you do require are probably going to be good about backwards compatibility [curl again as an example].