Live data from Hacker News

Xonsh: Python-powered, cross-platform, Unix-gazing shell

xon.sh

51–60 of 97 posts

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#51

Note, while you should feel free to use any interactive shell you like, you should only write scripts with POSIX sh. A friend of mine is working on another shell, mrsh, which aims to be POSIX-sh-as-a-library and will serve as the basis for building more sophisticated interactive shells on a POSIX base, if anyone is interested in that: https://git.sr.ht/~emersion/mrsh

While that's true for portability (there's obviously reasons why nearly all distros ship with a POSIX sh compatible shell at /bin/sh), for simple tasks on my own system, oftentimes I simply want to get the job done without banging my head against a wall dealing with all the idiosyncrasies of sh. For internal use, I think this project excels for automation and administration tasks. Of course, I probably wouldn't ship…

Because many distros ship with /bin/sh linked as bash, I think using arbitrary shells for your personal scripts encourages bad habits that can easily lead to mistakenly writing non-portable scripts elsewhere without realizing it. This has happened to me many times!

POSIX shell is not really worse than bash or any of the other choices imo. For tasks to which it's not suited, bash et al probably isn't either, and you should just use Python.

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#52

Note, while you should feel free to use any interactive shell you like, you should only write scripts with POSIX sh. A friend of mine is working on another shell, mrsh, which aims to be POSIX-sh-as-a-library and will serve as the basis for building more sophisticated interactive shells on a POSIX base, if anyone is interested in that: https://git.sr.ht/~emersion/mrsh

I have a better idea: don't write scripts in shell language at all. They're terrible at basically everything. Instead, use a scripting language, like Python, Ruby, or Perl. They have control flow that make sense, are not riddled with subtle bugs due to legacy and compatibility reasons, and are simply easier to wield. Shell scripts are a maintenance nightmare - even when used for personal scripts. They should be avoid…

Ruby and Python are pretty unwieldy for the kind of situations that are well-suited to shell scripts. It's a pain to spawn a command, a pain to make sure you get the process's output in the right place, and just far more overhead than necessary.

I agree, however, that classic shells are worse, because they lack many of the niceties expected in modern languages and have opaque, sensitive syntax.

fish shell has made me pretty happy. It's a great middle ground. It makes no pretense at POSIX compatibility. Truly a shell for the 90s.

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#53

Note, while you should feel free to use any interactive shell you like, you should only write scripts with POSIX sh. A friend of mine is working on another shell, mrsh, which aims to be POSIX-sh-as-a-library and will serve as the basis for building more sophisticated interactive shells on a POSIX base, if anyone is interested in that: https://git.sr.ht/~emersion/mrsh

I have a better idea: don't write scripts in shell language at all. They're terrible at basically everything. Instead, use a scripting language, like Python, Ruby, or Perl. They have control flow that make sense, are not riddled with subtle bugs due to legacy and compatibility reasons, and are simply easier to wield. Shell scripts are a maintenance nightmare - even when used for personal scripts. They should be avoid…

rc from plan 9 is simple but quite powerful and has very clean syntax. It also does away with the cruft in bourn. http://www.scs.stanford.edu/nyu/04fa/sched/readings/rc.pdf

There is a port of a few very useful plan 9 tools, including rc and the Acme editor, in https://9fans.github.io/plan9port/

https://en.wikipedia.org/wiki/Plan_9_from_User_Space

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#54
post #41

I love the concept, and I am generally happy with how it works. I think it should catch on. Except the damned name. Come on guys , there are already enough crazily named things out there, you didn't have to be another one :(

You know it's a pun on conch shell, right? ;-)

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#55

Note, while you should feel free to use any interactive shell you like, you should only write scripts with POSIX sh. A friend of mine is working on another shell, mrsh, which aims to be POSIX-sh-as-a-library and will serve as the basis for building more sophisticated interactive shells on a POSIX base, if anyone is interested in that: https://git.sr.ht/~emersion/mrsh

I have a better idea: don't write scripts in shell language at all. They're terrible at basically everything. Instead, use a scripting language, like Python, Ruby, or Perl. They have control flow that make sense, are not riddled with subtle bugs due to legacy and compatibility reasons, and are simply easier to wield. Shell scripts are a maintenance nightmare - even when used for personal scripts. They should be avoid…

shell is incredibly powerful when you interact with tools that use piping. Doing the same in python is much more verbose.

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#56
post #41

I love the concept, and I am generally happy with how it works. I think it should catch on. Except the damned name. Come on guys , there are already enough crazily named things out there, you didn't have to be another one :(

You know it's a pun on conch shell, right? ;-)

Wouldn't it make more sense if it was called "Ponsh" then? Heck, now that I think of it, "posh" would be a perfect name for a Python-powered shell.

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#58
post #41

I love the concept, and I am generally happy with how it works. I think it should catch on. Except the damned name. Come on guys , there are already enough crazily named things out there, you didn't have to be another one :(

You know it's a pun on conch shell, right? ;-)

That makes it worse. Too many names are based on insider-jokes, too many of it just scares away noobies.

posh, I agree, with the other poster, is a fabulous name for something like this

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#59

Earlier quoted context omitted.

I have a better idea: don't write scripts in shell language at all. They're terrible at basically everything. Instead, use a scripting language, like Python, Ruby, or Perl. They have control flow that make sense, are not riddled with subtle bugs due to legacy and compatibility reasons, and are simply easier to wield. Shell scripts are a maintenance nightmare - even when used for personal scripts. They should be avoid…

Ruby and Python are pretty unwieldy for the kind of situations that are well-suited to shell scripts. It's a pain to spawn a command, a pain to make sure you get the process's output in the right place, and just far more overhead than necessary. I agree, however, that classic shells are worse, because they lack many of the niceties expected in modern languages and have opaque, sensitive syntax. fish shell has made me…

Agreed.

There's definitely a good demand for a modern shell scripting language but fish is an existing solution that is saner than bash/zsh.

I don't use fish as a shell but for shell scripts only as it acted a bit weird on me, though it's possible I didn't search enough but zsh can cover pretty much all I want from fish with plugins.

Re: Xonsh: Python-powered, cross-platform, Unix-gazing shell

#60
I've always been thinking there can be a better shell like having a split pane to show the list of command options with descriptions as you start typing in the command or show snippets of a preset of command options that does task X as in search by use case instead of going to stackoverflow every time.

I think the way people handle shell, as in typing commands on a dumb shell, has not improved for decades and I don't know why. The only thing they help without explicitly asking is with autocompletion.

Post reply on HN