179 points · by Klasiaster · 5y ago · 50 comments
While I personally think shells that abandon POSIX/bash compliance are much more interesting as those can implement a sane scripting language, sticking with bash but improving interactivity is probably going to make more users happy as bash is so ubiquitous.
Is it really? Projects like ble.sh [1] seem to pull off advanced features like syntax highlighting and enhanced completion with pure bash without the need for reimplementing a whole shell from the ground up.
I like zsh because it is mostly (entirely?) POSIX compliant, but adds extended features. I think that's the best approach to make it easier for people to start using your shell.
random note: back when the Go language was first released I wanted to try it out.. I started making a shell that I called GoSH. Didn't get very far, you could execute programs, change directories etc. It was fun! And taught me a lot about low level languages.
For anyone after an upgrade path from Bash/Zsh then Oil shell is a lot more mature: https://www.oilshell.org/
What does this really mean? Especially the ergonomic part?
For example, replacing "&&" and "||" with "and" and "or", is not an improvement. There are many other such changes that make the shell more verbose without bringing any advantage.
This also happened with the C shell, csh, which introduced some convenient new features for interactive use, but it also included a large number of gratuitous changes in the syntax that were not improvements.
> For example, replacing "&&" and "||" with "and" and "or", is not an improvement. There are many other such changes that make the shell more verbose without bringing any advantage.
In Fish, `and` was never a synonym for `&&`, and `or` was never a synonym for `||`. Fish's use of `and` and `or` also did not introduce any syntax that you won't find in Bash and friends. `and` and `or` in Fish are _commands_, and they use the _pre-existing syntax_ for _normal commands_.
This is absolutely an improvement, because it's strictly less syntax that allows you to do all of the same things with virtually no increase in the number of characters. `; or` is only a single character more than ` ||`, and `;or` is the same number of characters as ` ||`. This is a very bad example of ‘increased verbosity’.
If you like this syntax, that is fine, but I do not like it, and I also find it illogical, because McCarthy "and" and McCarthy "or" are really alternatives to the sequential execution denoted by ";", not something that is done after a sequencing delimiter, so this and many other details like this have prevented me to switch to using fish, even if fish also has many other features that I like.
Also, I have never reached deep enough in the fish documentation to discover how you can write the equivalent of:
cmd1 && cmd2 || cmd3 && cmd4 &
from traditional shells, when "and" and "or' are ordinary commands. I assume that you might need to use parentheses before "&".The fact that not only the symbols have been substituted but they have also been made ordinary commands is a serious regression. Less syntax that removes your ability to write something is not an improvement.
For any shell wannabe, there is a very large part of the syntax used by ksh/zsh/bash that can be changed without problems, e.g. conditional structures, loops, variable and function definitions, various kinds of parameter expansions and expressions and so on.
None of those is specific for a shell language and it is likely that better replacements can be found.
On the other hand, for the syntax of a shell command list, which uses expansions, redirections and "|", "&&", "||", ";", "&", nobody has found yet a better alternative so any shell should better keep it unchanged.
I applaud this project for bringing fish goodness to more people, although I don’t quite get why people cannot just learn fish. Fish is very simple. There is not that much to learn.
Maybe it matters if your write a lot of shell scripts but for anything complicated I use Julia, Python, Go or some other more proper language.
To me shells are mainly for interactive work and really simple scripts without control flow, beyond perhaps a for loop.
The experience out of the box (coupled with something like starship) is pretty good but I don't like the incompatibility with basic things, like $() vs ().
I also find fish to be a bit on the slow side in some instances, so I think I'll keep tabs on nsh
Configuration isn't for you. It's for other people. Configuration is the part of a program that performs the function of making it useful for more than one person. It is the necessary glue that brings together many developers and many users into one project.
Just to state the obvious examples, i18n is exposed through configuration, accessibility features are configurations. These aren't optional parts of a program that can simply be designed around.
To be clear, I agree with you that human preferences are valid as such, just clarifying that your parent comment is profoundly wrong even if you think that all people ought to have the same preferences.
(fish)$ bash
(fish>bash)$ source ./random.sh
(fish>bash)$ fish
(fish>bash>fish)$I mainly use fish for interactive work not for programming. Then I use a real programming language.
If features are integrated, then I would probably want to have something about error handling because it is difficult to get right in bash even with shellcheck¹ plus shellharden², and gets just worse when things run in parallel.
http://nuttx.incubator.apache.org/docs/latest/applications/n...