Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice, I've been waiting for a good modern shell to replace ZSH. Fish just wasn't enough of an improvement for me to abandon ZSH. This is an area where most open-source developers have avoided, as it's a "solved" problem, but it really isn't.

I'm currently waiting on Elvish [1] to mature. It's written in Go [2], but they're developing a new language on top of it for shell scripting, which I tried for a week. It's a nice modernization and is incredibly fast but still very alpha.

You don't realize how slow ZSH/Bash is (even without plugins) until you try a modern shell, and there are very few good modern shells around.

Besides performance my primary complaint is just how awful coding in ZSH is. I've been doing it for years and I still feel like I'm running into walls constantly and struggling to write 'clean' code that isn't full of hacks and workarounds.

High performance + modern scripting language = my ideal future shell

[1] https://elvish.io/

[2] https://github.com/elves/elvish



> This is an area where most open-source developers have avoided, as it's a "solved" problem, but it really isn't.

I've found the complete opposite to be the case. This is one area where there are hundreds of different shells out there as it seems a "cool" thing to try since it's basically just an extension of writing your own language. Most never go beyond pet projects though.

If you're curious about Go shells, I'm writing one too[1]. It's also alpha but you can already write some reasonably complex scripts in it since it supports message passing, network sockets and background processes. It's definitely not fast though. Fast enough for what I need it to do but there's plenty of room for performance tuning once in beta.

[1] https://github.com/lmorg/murex


> This is one area where there are hundreds of different shells out there... Most never go beyond pet projects though.

I have had the same experience. For every scripting/interpreted language out there, there is at least one person who thinks "ooh, wouldn't it be neat if I could use this as a shell?" or, almost as often, "to program my text editor?" Soon they realize that interactive programs like shells and text editors are hard to get right. There are thousands of special cases and non-obvious features that have only been found by hard experience. These programs must also interact with a computing world that has evolved over decades.

Most programmers give up at this point. A few persist, and of those, a few end up creating something genuinely useful to more than themselves and a couple of friends. I'm not sure if I would call shells a "solved" problem, but I don't believe the incredible amount of work required to make a sufficiently better one is worth it.


From an academic perspective I think it is totally worth the effort. It can teach you how to write a parser, a greater understanding of pseudo-TTYs, process IDs, and UNIX file streams (eg handling EOT bytes). Plus ANSI escape sequences (for readline support), globbing, etc. There's a lot of theory that can be learnt from writing even an unsuccessful shell. Even with myself who has been a Linux administrator for 10+ years and a developer for twice that, there were lessons I've learned when writing murex.


Rash? Rust Already SHell (There's already a "RuSH" made with Ruby). Oh. https://github.com/redox-os/ion

CLASH - Common Lisp Again SHell? Oh. http://www.cliki.net/CLISP-Shell

Doh! https://docs.racket-lang.org/rash/index.html

Someone put OO in my Linux shell! https://virtualizationreview.com/articles/2017/06/01/how-to-...


There's also "oh shell", written in Go but exposing a Scheme-like language: https://github.com/michaelmacinnis/oh


or you could go with SCSH, an actual scheme shell: https://scsh.net/


Program in rc shell[0]. It has a much superior syntax, and can manage piped commands. The use of the single quote to mean "really fucking quote", and $* working as every user would expect.. makes it a joy.

[0]: https://github.com/rakitzis/rc

Secondly, I use rc in emacs shell-mode which poorly emulates a terminal, so advanced completion and all that other stuff I delegate to emacs. rc is just a programming language that supports shell commands extremely well.


I'm a big fan of fish, particularly with omf. Though honestly it has some performance issues, particularly if your prompt line calls something that could take some time to resolve (such as git status or a du).


I've been having big performance issues with tab completion. Also, I just don't find the language to be that much better than bash, and writing in fish means i can't share my shell scripts with any coworkers. I've been writing everything in bash lately even though i still use fish.


Same. I love fish as an interactive shell, but write all my scripts in Bash or some other, suitable scripting language. I don't mind having separate interactive and batch languages.


That's basically my biggest problem with fish. If I could get 99% of the functionality with near complete language incompatibility with bash, that would be ideal.


Same here. I've been using Fish with Fisherman and the pure theme. Very fast.


Elvish author here, I am glad that you like it. Feel free to drop me questions :)


> Nice, I've been waiting for a good modern shell to replace ZSH.

I think xonsh is a good modern shell to replace bash/zsh/*sh. The only two issues are: 1) it has the stupidest name ever with an even more stupid pronunciation, 2) it's great, it's going toward a great direction, but it fails in one of your key areas for what makes a good shell: speed, it's very slow.

But regarding speed, please tell me how you find most shells to be too slow? Most of the time you're in shell you're not even doing shell stuff, you are rather using tools like ls and find and grep, etc. For the almost 2 decades I've been using bash, it never felt "slow" to me. xonsh feels slow, but at least the python-esque of it makes it a pleasure to use (except where you hit areas where it doesn't work well... I hope that improves over time though)


Sounds like what you want is more along the lines of the Ion shell[1], rather than Elvish. It's written in Rust, and the performance well exceeds Dash (written in C), despite having a lot of features that Dash is unable to do efficiently. Go's just not a good a language for writing a shell, especially once you get into job control and signal handling, or if you care about performance.

Some of the great features you won't find in Bash or Zsh are the string and array methods[2], first class arrays[3], slicing syntax[4], tuple assignments[5], optionally type-checked assignments[6], ability to use functions within pipelines, typed function parameters, a much simpler syntax, and more. Many of the best ideas from Fish, Oil, Elvish, Bash, Zsh and other shells have been implemented or are in the process of being implemented.

- [1] https://github.com/redox-os/ion/

- [2] https://doc.redox-os.org/ion-manual/ch05-05-method.html

- [3] https://doc.redox-os.org/ion-manual/ch04-02-arrays.html

- [4] https://doc.redox-os.org/ion-manual/ch06-00-slicing.html

- [5] https://doc.redox-os.org/ion-manual/ch04-00-variables.html#M...

- [6] https://doc.redox-os.org/ion-manual/ch04-00-variables.html#T...


I've been using xonsh (shell + Python ) for about 18 months now to great effect. Bash stuff basically works as-is because of the operational semantics that completely separate shell stuff from Python stuff

If you're looking to contribute to something, the devs are really helpful and open to stuff (I was able to hack together an autopair feature pretty quickly and they took it)


elvish looks a bit like powershell




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: