Live data from Hacker News

Why Create a New Unix Shell?

oilshell.org

21–30 of 298 posts

Re: Why Create a New Unix Shell?

#21
post #19

Earlier quoted context omitted.

Why do people care about "COMPATIBILITY" so much w.r.t. shells? It's so easy to use other shells to run your script. > /bin/bash your_script.sh And if your script is written with bash in mind, use a shebang: > #! /bin/bash And it will work perfectly fine on fish. As long as I have a bash binary, why do I need COMPATIBILITY?

To copy and paste stuff from the internet.

That's a great argument for fish.

Re: Why Create a New Unix Shell?

#22

> Shouldn't we discourage people from writing shell scripts? ...people frequently ask this? Tip #21 of "The Pragmatic Programmer" states: "Use the Power of Command Shells."

Manipulating processes, exit codes and output is idiomatic in shells and that's where they shine. I totally agree with you. In a general purpose programming language there's a lot of overhead for doing the same things. For maintainability, there are now linters for shell languages that can help making the job easier.

> linters for shell languages

Obligatory in case anyone hasn't seen it:

https://www.shellcheck.net/

Works as a web app or local tool.

Re: Why Create a New Unix Shell?

#23

Lots of overlap in design goals with fish, except fish also places a premium on users interactively using the shell (which means friendlier in-repl experience but a balancing act when it comes to features). Fish’ auto completions are incredible, too. Best of luck to them. Another interesting shell to check out is elvish, lots of new ideas there (even if awkward to use). (Disclosure: I’m one of the core fish devs/main…

Thank you for your work on fish. It’s simply awesome. I love that I have only needed minimal amounts of tweaking. So far my fish.config is ~7 lines in total.

Re: Why Create a New Unix Shell?

#24

Lots of overlap in design goals with fish, except fish also places a premium on users interactively using the shell (which means friendlier in-repl experience but a balancing act when it comes to features). Fish’ auto completions are incredible, too. Best of luck to them. Another interesting shell to check out is elvish, lots of new ideas there (even if awkward to use). (Disclosure: I’m one of the core fish devs/main…

(author here) Hm I've tried fish, and it seems very nice for interactive use.

However I don't see it being used AT ALL for the cloud/linux use case? Those are the cases where you tend to get 1000+ lines of shell scripts.

For example, I mention Kubernetes/Docker/Chef, and I've never seen fish in that space.

I also don't know of any Linux distro that uses fish as their foundation -- they all appear to use a POSIX shell like bash/dash/busybox ash. fish is "on top".

See Success with Aboriginal, Alpine, and Debian http://www.oilshell.org/blog/2018/01/15.html -- these distros are built with thousands of lines of shell scripts.

Either 1) I don't know about such usage, 2) people don't know that fish can be used this way, or 3) there is some problem with using fish this way.

I link to this post in the FAQ, which I think is a lot closer to Oil:

https://ilya-sher.org/2017/07/07/why-next-generation-shell/

It's basically the "devops" use case. (And as I mention the main difference between Oil and NGS is that Oil is compatible / has an upgrade path from bash.)

Re: Why Create a New Unix Shell?

#25
I checked out Oil previously which looks nice but more of an incremental improvement over Fish/ZSH rather than a significant evolution (it may have changed since then, this was last year).

Im most excited about Elvish shell and the language that's being developed around it. The shell is built with Go and feels super fast compared to my plugin-heavy ZSH. The language design is quite nice too but still very alpha. Looking forward to see what it evolves into...

https://github.com/elves/elvish

Re: Why Create a New Unix Shell?

#26

Earlier quoted context omitted.

Manipulating processes, exit codes and output is idiomatic in shells and that's where they shine. I totally agree with you. In a general purpose programming language there's a lot of overhead for doing the same things. For maintainability, there are now linters for shell languages that can help making the job easier.

> linters for shell languages Obligatory in case anyone hasn't seen it: https://www.shellcheck.net/ Works as a web app or local tool.

Please note that copying and pasting commands from a web browser into a terminal can result in malicious code being executed.

A good idea to double check using a text editor.

http://thejh.net/misc/website-terminal-copy-paste

Re: Why Create a New Unix Shell?

#27

Earlier quoted context omitted.

Why do people care about "COMPATIBILITY" so much w.r.t. shells? It's so easy to use other shells to run your script. > /bin/bash your_script.sh And if your script is written with bash in mind, use a shebang: > #! /bin/bash And it will work perfectly fine on fish. As long as I have a bash binary, why do I need COMPATIBILITY?

If you use the same shell interactively as you script in, then you only have to learn the one language.

Except Oil has both POSIX compatibility and Oil. It's not much difference from Fish, where you can largely ignore the built-in scripting language and just write bash scripts if you'd like.

Re: Why Create a New Unix Shell?

#28
post #10

Finally a modern shell that understands the importance of COMPATIBILITY! This gives it a realistic chance of getting real adoption. Shells like zsh and fish will never get mainstream adoption because they are not compatible with bash.

NodeJS is doing all right. Ducks!

Re: Why Create a New Unix Shell?

#29
post #10

Finally a modern shell that understands the importance of COMPATIBILITY! This gives it a realistic chance of getting real adoption. Shells like zsh and fish will never get mainstream adoption because they are not compatible with bash.

Why do people care about "COMPATIBILITY" so much w.r.t. shells? It's so easy to use other shells to run your script. > /bin/bash your_script.sh And if your script is written with bash in mind, use a shebang: > #! /bin/bash And it will work perfectly fine on fish. As long as I have a bash binary, why do I need COMPATIBILITY?

Why do people care about "COMPATIBILITY" so much w.r.t. C compilers? It's so easy to use other compilers to build your program.

> CC=gcc make

And if your program is written with gcc in mind, put that in the Makefile:

> CC ?= gcc

And it will work perfectly fine on LLVM systems. As long as I have a gcc binary, why do I need COMPATIBILITY?

----

A big part of the long-term objectives of OSH is that it provides a way to move to a better language, without having to entirely rewrite your codebase. Think of it in a similar spot to C++ (originally); a big part of the design is that your old C (bash) code is already valid C++ (osh), and you can start using new C++ (osh) features wherever you see fit in the codebase, without having to rewrite anything first.

Re: Why Create a New Unix Shell?

#30

Lots of overlap in design goals with fish, except fish also places a premium on users interactively using the shell (which means friendlier in-repl experience but a balancing act when it comes to features). Fish’ auto completions are incredible, too. Best of luck to them. Another interesting shell to check out is elvish, lots of new ideas there (even if awkward to use). (Disclosure: I’m one of the core fish devs/main…

I love fish! It's my jam thanks for doing what you do!
Post reply on HN