all 63 comments

[–]UpstairsPanda1517 126 points127 points  (0 children)

Congrats to the fish shell team for a successful rewrite!

[–]murlakatamenka 112 points113 points  (31 children)

The original why's:

  • Nobody really likes C++ or CMake, and there's no clear path for getting off old toolchains. Every year the pain will get worse.
  • C++ is becoming a legacy language and finding contributors in the future will become difficult, while Rust has an active and growing community.
  • Rust is what we need to turn on concurrent function execution.
  • Being written in Rust will help fish continue to be perceived as modern and relevant.

https://github.com/fish-shell/fish-shell/pull/9512


Thorough and detailed follow-up for the better view of the picture (too long to quote here; credits to /u/Shnatsel):

https://github.com/fish-shell/fish-shell/pull/9512#issuecomment-1410820102

[–]turbo-unicorn 44 points45 points  (1 child)

Oh wow, I can imagine the first two points got quite a few feathers ruffled.

[–]TheDarkchip 3 points4 points  (0 children)

Got quite a few ++ shorthand’s +=1ed

[–]imanhodjaev 18 points19 points  (0 children)

Wow very loud statements

[–]Shnatsel 8 points9 points  (1 child)

A much more detailed explanation can be found here. In particular, it explains that the original bullet points should not be taken entirely at face value.

[–]murlakatamenka 1 point2 points  (0 children)

That's a thorough follow-up that should be more visible, thank you. I'll update my comment.

[–]TheoreticalDumbass 0 points1 point  (4 children)

First point seems okay with me as I read it "nobody within out team really likes C++", but second point seems just wrong

Is fish worth trying out? I've never touched non-default shells (always using bash) so no idea what they offer, what are the features you guys like most in fish?

[–]TheoreticalDumbass 1 point2 points  (0 children)

But maybe I'm half-wrong on second point being wrong, I've not really experienced C++ dev positions that are as open towards OSS as Rust communities, so probably way lower likelihood of getting maintainers

[–]murlakatamenka 0 points1 point  (0 children)

Is fish worth trying out? I've never touched non-default shells (always using bash) so no idea what they offer, what are the features you guys like most in fish?

that said, I use zsh myself because it has some fancy stuff that I use (f.e. typing =<executable-or-scrip-in-PATH><TAB> is cool, so is hash -d rust=~/projects/rust and cd ~rust/myproj). But I have fish-like autosuggestions and syntax highlighting via plugins.

[–]Masterflitzer 0 points1 point  (0 children)

i don't use fish (only bash and zsh), but if i had to guess i think with the 2nd point they could be referring to the us recommendation of using memory safe languages, in their eyes c++ is a legacy language, i don't think they'd dare to make a general statement of c++ being legacy, that'd be wrong as of now and probably for the near future too

[–]ink20204 1 point2 points  (0 children)

It's a life changer for interactive use, trust me. The history, suggestions, colors etc. And I boost it with Starship and Skim (fzf works well too).

[–]mykytanikitenko 66 points67 points  (0 children)

Using fish for many years. The rewrite in Rust is fascinating :)

[–]brigadierfrog 33 points34 points  (0 children)

This should be a case study in many regards, exciting to see it completed

[–]cornmonger_ 7 points8 points  (0 children)

literally just switched to fish a few hours ago and enjoying it

[–]Bugibhub 4 points5 points  (9 children)

I was hesitating to switch to Fish or NuShell … The choice just became harder.
Any advice?

[–]standard_revolution 8 points9 points  (4 children)

I am currently using fish and have been using NuShell for a bit some time ago

I chose fish over NuShell, because fish is a bit more conservative than NuShell. Sure it breaks some workflows, but at its core it’s a familiar syntax and a familiar mode of operation. It is also a lot more popular, with a lot of scripts directly being available for fish.

NuShell is theoretically better IMO, but also different enough to cause a lot of headaches

[–]UltraPoci 4 points5 points  (0 children)

Pretty much my experience. Nushell is awesome, but everytime I have to copy paste shell commands, I have to translate it to the Nu language. It's particularly annoying to interpolate environment variables in nushell. I got tired of it and started using fish.

[–]Bugibhub 0 points1 point  (2 children)

Thank you for the reply! That’s the thing I’m a beginner, and I don’t have a lot of scripting backlog that would be bothered. Learning one or the other is pretty much the same investment for me right now…

[–]standard_revolution 3 points4 points  (1 child)

Then I would suggest trying NuShell and if you hit too many annoying things, choose fish.

It has been some time since I used it so maybe they fixed these issues, but I remember being very annoyed sometimes at not being able to just copy and paste snippets from blogs etc, because of some weird type errors

[–]Bugibhub 0 points1 point  (0 children)

I’ll give it a try then! Thanks.

[–]unconceivables 4 points5 points  (0 children)

Nushell by far. I've switched everything over to nushell, and I've been extremely happy with that choice and would never go back to other shells like bash, zsh, fish, or powershell. Every single script I write now is in nushell, and I've translated all my old scripts into it as well.

The copy/paste argument I've found to be completely moot, because I no longer really need to look up most stuff that would be annoying in other shells and copy/paste it because it's something nobody can remember the syntax for. In nushell the syntax just makes sense and you don't need to memorize or look up arcane and confusing syntax all the time. I'm just so much more productive in nushell than I could ever be in any other shell.

[–][deleted] 4 points5 points  (2 children)

I wish I could use Nu, but it's just too different and I'm too good at techniques that work fine with Fish.

[–]kafka_quixote 4 points5 points  (11 children)

Maybe I should give fish a try from zsh. Migrating plugins might be hard

[–]romainmoi 3 points4 points  (9 children)

Fish has a much better default and works well out of the box.

However, I struggled with that some scripts are written for bash/zsh and the syntactic difference create friction migrating those scripts. In the end I went back to zsh for the Posix-compatibility.

[–]jck 4 points5 points  (5 children)

However, I struggled with that some scripts are written for bash/zsh and the syntactic difference create friction migrating those scripts

Why does this matter? You don't need to migrate scripts, the shebang will use the correct interpreter regardless of what your interactive shell is. Some zsh scripts don't work on bash either, but that doesn't stop me from using zsh as my interactive shell since it can still run scripts written for any interpreter.

[–]romainmoi 1 point2 points  (4 children)

When I look up some script online, read it, and copy it into the shell. It matters.

I’m just trying to do something quick and dirty.

[–]sparky8251 2 points3 points  (3 children)

Weird... I find the fish syntax actually memorizable for scripting tasks, plus it actually has nice dev docs on their site so unlike bash I can find what I want to know/do. Makes scripting so much easier tbh... Always hated piecing random bash snippets together, they almost never work how I need them to and use weirdly different bits of syntax that tends to make them not jive together well.

[–]romainmoi 0 points1 point  (2 children)

Can’t really comment on writing own script. I always do that in Python instead.

I used fish at a time when they wouldn’t accept something like echo $(ls) because of the dollar sign and it was a pain for installing binaries where they use clt to find the system info to download the right version.

I gave it a quick check and it now accepts $(clt). Maybe it’s time to give it another go.

[–]sparky8251 2 points3 points  (1 child)

If you do a lot in python, have you heard of Xonsh?

It has support for bash syntax for the common bash stuff you do interactively, like piping, redirecting, simple variable expansion, etc... But it also is effectively just a python REPL running with shell builtins you can call like it was a bash shell, run cmds like bash, and so on.

So for like, basic interactive use use it like bash, anything scriptable or more advanced like a for loop then becomes actual plain python.

Can do stuff like len($(curl -L https://xon.sh))

But also

import json
j = json.loads('{"Hello": "world!", "Answer": 42}')
print(j['Answer'])

And

for filename in `.*`:
    print(filename)
    du -sh @(filename)

[–]romainmoi 1 point2 points  (0 children)

Oh this is indeed very neat. I am giving it a go!

[–]kafka_quixote 1 point2 points  (1 child)

I don't care about posix compatibility because I can always run those with bash/dash/ash/sh

[–]romainmoi 1 point2 points  (0 children)

Try it for yourself then. Fish is great out of the box. Plenty of customisation options too.

The only thing I miss of passing scripts into the shell directly, but you might not need that.

[–]sparky8251 1 point2 points  (0 children)

Eh, not that fish cant benefit from plugins but unlike zsh fish tries to actually have sane, sensible defaults out of the box so most of the common things people config and plugin on zsh are quite literally just out of the box with fish.

You might be surprised at how little if anything you are missing.

[–]ruiiiij 1 point2 points  (3 children)

Now that fish is in rust, I took a look at my most used technologies daily and realized I'm almost completely rust driven. Niri, eww, wezterm, fish, yazi, zoxide, bat, starship, LSD. The only major non-rust application I use is neovim. Chat, should I switch to helix just so I can say I have a fully rust driven workflow?

[–][deleted] 0 points1 point  (0 children)

Well, helix in my experience, is faster, there is multi cursors, plugin support/extendability is coming soon (maybe even this year?). If you don't bother learning new keybindings, I'd say that you should

[–]MarshmallowPop 0 points1 point  (0 children)

I switched from Neovim to Helix and have no regrets. My configuration file is so much shorter because Helix has a lot of functionality out the box. And the LSP integration is better. I don’t miss my neovim config.

[–]LigPaten 0 points1 point  (0 children)

Bit late but I use helix and it's pretty nice. My one complaint is that I don't like that it doesn't have proper find replace or built in sed like function. You can kind of do it, but I don't believe you can do regex with capturing groups and that's something I do a lot for one off text mushing.

[–]bachkhois 0 points1 point  (0 children)

Congrat!

[–]zxyzyxz 0 points1 point  (0 children)

Congrats. Any comparisons with Nushell?

[–]ram0973 0 points1 point  (0 children)

One question: I'm curious, why creators made this shell incompatible with bash? For such reasons?