> fundamentally bad for scripting/programming […] a mechanism we wouldn’t accept in a regular programming language
I don’t agree with this assumption that shell should use mechanisms we accept in “regular” programming languages, whatever that means. And why not the other way around? Why do we accept mechanisms in programming that we wouldn’t accept in a shell? There are layers of assumption in your assumption.
I also disagree with lumping scripting and programming together. Those are two different activities, and shell is better at scripting than programming, and it’s better at scripting than programming languages.
Try using python as your shell, and you’ll find out that python is fundamentally bad as a shell REPL. The shell is necessarily different from python or C++ or <your_favorite_programming_language>, starting with the ability to run command lines by typing them, with zero extra syntax. That is something regular programming languages can’t do, and it leads directly to the need for string substitution rules.
If you want a shell made out of a good programming language… make one! People have been thinking about this for decades and nobody has come up with a good one, because shell languages like bash are better at shelling than programming languages.
a bunch of happy xonsh users disagree
Hey good! I’d like a good python shell. Does xonsh fix cut and paste with python? The first huge problem I ran into with python shelling is you can’t cut as paste indented code at all.
Edit I’m reading about it, here are some notes to myself:
Sounds like there are 2 modes, subprocess & python
Env vars are still string substitution, and there are many rules and string literal prefixes.
You will want the prompt toolkit (ptk). It’s an additional install. (Non-default installs, btw, are why I stopped using zsh. I loved zsh, but had to move to bash.)
Regexes use backticks
@.imp for inline imports… good idea
BTW I googled for xonsh complaints and got what I expected; awkward & klunky interactive editing, special prefix syntax, some missing features, system python dependency issues, high CPU usage, and lack of portability. People seem to suggest that xonsh is better for scripting than interactive usage.