4 ms·
Which is impossible, which is why no new shells have caught fire. In order to preserve compatibility, you must handle quotes, namespaces, etc in the same way a
by hannasanarion 6y ago
Which is impossible, which is why no new shells have caught fire.
In order to preserve compatibility, you must handle quotes, namespaces, etc in the same way as Bourne-derived shells, because they will be expected to run scripts that use nested interpolation, or string declarations without quotes, or whatever. Shells that use a more robust syntax, like Fish or Powershell, can't ever be compatible.
- majkinetor 6y agoNot exactly true since PowerShell is doing quite good regarding popularity nowdays...
- mdaniel 6y agoFrom my perspective, that's partially because CMD is so stunningly incapable as what a reasonable person might think of as a shell. I'd guess the other half is the amount of pressure Microsoft has placed upon management tooling using PS If Apple shipped some Swift-powered shell and all of their management documentation started using it, I'd bet a non-trivial portion of administrators would start to use AppleSwiftShell (although I do deeply appreciate that's a severely flawed comparison since macOS already has a sane functioning shell, but it's the best I could think of as a huge company that owns the platform pushing such a concept down)
- majkinetor 6y agoI doubt. Most people still use cmd because they dont care. Its doing good because it is good and people started to notice once MS propriatery chains went down.
- hodgesrm 6y agoI can't speak to the implementation details but there must be a middle ground where you can set compatibility using 'set -N' or some similar approach to enable new behavior. Scripting languages like Python, Ruby, Perl, etc., have dealt with upgrade many times. It has not always been pretty, but the alternative is stagnation.
- chubot 6y agoYup, it's already been done with 'shopt -s simple_word_eval' in Oil, see right above: https://news.ycombinator.com/item?id=24086213 https://news.ycombinator.com/item?id=24086213 And yes I drafted a blog post called "Unix Shell Should Evolve Like Perl 5" which says exactly what you are saying: http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-unix-shell-should-evolve-like-perl-5 http://www.oilshell.org/blog/2020/07/blog-roadmap.html#the-u... And Oil has already done it. It needs to be faster, but that's an inevitability based on progress so far. Why Use Oil? http://www.oilshell.org/why.html http://www.oilshell.org/why.html
- chubot 6y agoIt's possible, and http://www.oilshell.org/ http://www.oilshell.org/ has done it: http://www.oilshell.org/release/latest/doc/simple-word-eval.html http://www.oilshell.org/release/latest/doc/simple-word-eval.... You can try it right now. Turn on 'shopt -s simple_word_eval' to get the better behavior. Or turn on the group 'shopt -s oil:basic' and get even more better behavior. When those options are off, Oil runs some of the biggest shell scripts in the world. It's the shell that's most compatible with bash by a mile. https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run-Under-OSH https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run...
- int_19h 6y agoFish is plenty popular regardless of all that. Sure, it won't replace Bash, in a sense that you'd have Fish handle all the scripts on the system - that's impossible for backwards compatibility reasons. But it's used as a primary interactive shell, and for custom system & user scripts, by a lot of people.