Live data from Hacker News

Why Create a New Unix Shell?

oilshell.org

21–30 of 63 posts

Re: Why Create a New Unix Shell?

#21

> GNU bash is the most popular shell implementation in the world. It was first released in 1989, and implements the POSIX standard plus many extensions. It's the default shell on most Linux distributions, runs on BSD Unix variants, used to ship on Mac OS X, and runs on Windows. Note that macOS still ships bash.

I haven’t had a Mac in a few years but iirc they ship zsh* nowadays not bash

Default shell is zsh. They ship old version pre-GPL3 bash. I just “brew install bash” and then change my user shell in the system preferences to point at it.

Re: Why Create a New Unix Shell?

#22

It's only tangential but switching to fish shell made me about 3 times more productive. Being able to easily recall commands, to have completions displayed as I type, and to have interactivity be a first class citizen of the environment... made working in the shell so so so so much nicer. Fish has its own quirks, some of which seem unnecessary, but it was a godsend. There is definitely still room for improvement of t…

My least favorite fish quirk is that you cannot use stty to remap Ctrl-C. You need to use stty in another shell, then exec into fish to remap it.

Good news: In the upcoming 3.2 release, fish will be less insistent on resetting terminal modes, so things like this (and enabling flow control) will be possible.

(I'm the fish dev who implemented that)

Re: Why Create a New Unix Shell?

#24

Greetings! First off, any person who would write either a language or a shell, now or in the future, should read your page, and in fact, should read everything about your Oil shell/language... It's a laudable effort! This page is going to my HN favorites, for future review. What follows next are my thoughts about selected excerpts of text on the page (please don't interpret as criticism, that's not the intent): >"You…

(author here) Thanks for the comment! I do think you hit on something interesting, and it partly explains why the project is so big :)

To me, shell and Python/JS feel kind of similar, and that was sort of the thesis at the start of the project.

But if you just incrementally add features to Bourne shell, you basically get Korn shell, which is where bash got all the "bashisms" that people don't like.

This paper was surprising to me; the proprietary AT&T ksh was used for GUIs and so forth, AND it was embeddable like Lua:

http://www.oilshell.org/archive/ksh-usenix.pdf

[ksh] has the capabilities of perl and tcl, yet it is backward compatible with the Bourne shell. Applications of up to 25,000 lines have been written in ksh and are in production use.

Much of the impetus for ksh–93 was wksh, which allows graphical user interfaces to be written in ksh.

It's a lot more work to make something like Python or JS! Garbage collection is one issue; shells don't have it because they don't have recursive compound data structures or true functions.

So I would say that ksh "failed" because it took a lot of shortcuts. Perl, Python, Ruby, JS, and PHP won. So with Oil I also am upgrading shell, but it was a lot more work since I wanted to make it like the latter languages. It wasn't obvious at the outset how different these things are!

So in a sense Oil is upgrading shell to be more like the languages that won, which I still think is a good idea. It's weird that every computer boots to into a programming language REPL, but you're discouraged from learning it because it sucks. There's no reason that language shouldn't be a good one.

---

Yes pipelines are a big deal and the runtime is solid now so they can be enhanced. Ideas here, feel free to chime in: https://github.com/oilshell/oil/issues/843 :)

Re: Why Create a New Unix Shell?

#25

It's only tangential but switching to fish shell made me about 3 times more productive. Being able to easily recall commands, to have completions displayed as I type, and to have interactivity be a first class citizen of the environment... made working in the shell so so so so much nicer. Fish has its own quirks, some of which seem unnecessary, but it was a godsend. There is definitely still room for improvement of t…

Interesting, it seems a 3x productivity boost to all programmers and admins would be a no brainer for the industry.

Re: Why Create a New Unix Shell?

#26
post #17

This reminds me: why isn't there a good Python shell? Something with, as the author says, a "domain-specific language for dealing with concurrent processes and the file system", but otherwise basically Python? I'm sure people must have tried, so I guess there are fundamental incompatibilities between the two?

You might be interested in Xonsh: https://xon.sh/

Re: Why Create a New Unix Shell?

#28

It's only tangential but switching to fish shell made me about 3 times more productive. Being able to easily recall commands, to have completions displayed as I type, and to have interactivity be a first class citizen of the environment... made working in the shell so so so so much nicer. Fish has its own quirks, some of which seem unnecessary, but it was a godsend. There is definitely still room for improvement of t…

How does fish compare to zsh? I just switched from bash to zsh and am loving it.

Re: Why Create a New Unix Shell?

#29
Others' experiences may vary but personally speaking I have to write a fair amount of shell scripts that run on a range of machines, networks etc. At best its a pita to change shell on these ephemeral boxes, worst case its out of my control.

The lowest common denominator ends up being the good ol' bash (or sh)! Sure fish/oil is nice but quite a bit of mental gymnastics to keep them all straight in my head.

Post reply on HN