Live data from Hacker News

Fish 4.0: The Fish of Theseus

fishshell.com

71–80 of 204 posts

Re: Fish 4.0: The Fish of Theseus

#71
post #68

I love fish and I’ve been a user for years. In the wake of AI, I am really interested in getting out of completes via a local tiny AI model Does the fish team have any plans for integrating AI models for other completion?

We ship fish with completions ollama and llm, maybe others. We don't have any plans to "integrate" AI into the actual codebase.

I had no idea! Where can I find docs to set this up?

Re: Fish 4.0: The Fish of Theseus

#72

Earlier quoted context omitted.

I write all my scripts with the hash bang as "#! /bin/bash" so even though fish is my interactive shell, I still use bash for all shell scripts. I think the restrictions you mention only apply if you use "#! /bin/sh" rather than bash specifically.

Just fyi, you should use `#!/usr/bin/env bash` instead of `#!/bin/bash` or whatever because you can't assume the location of bash (but the location of `env` is indeed portably fixed). e.g. FreeBSD (and macOS?) has bash at `/usr/local/bin/bash`

And NixOS has bash somewhere in the Nix store... :)

Clarification: /usr/bin/env should be used for pretty much every shebang since it looks up the binary on $PATH.

Re: Fish 4.0: The Fish of Theseus

#73
The tone in the "The Timeline" section seems apologetic:

> The initial PR had a timeline of “handwaving, half a year”. It was clear to all of us that it might very well be entirely off, and we’re not disappointed that it was.

I'm amazed that you estimated it at so little time originally, and I'm amazed you shipped it in full in just 2 years. Congrats!

Re: Fish 4.0: The Fish of Theseus

#74

Earlier quoted context omitted.

Rust binaries, once stripped, are not necessarily much fatter than their C++ counterparts. We're not expecting a huge increase there. Embedded distros should still be supported, though you might need to cross-compile for a few depending on rust toolchain availability. Cygwin is supposed to be getting a working rust target at some point, but who knows?

I fully expect fish 4.0 to be in openwrt (because openwrt runs on x86_64), but what percentage openwrt machines have the space to run it would be interesting (I suspect it won't be an issue, as likely those near the lower limit of openwrt are probably sticking with busybox anyway, and not installing a different shell). Personally, what I want is inexpensive hardware (routers, but also storage devices) that don't use…

I know rust-fish is being used on at least some non-x86_64 non-aarch64 routers because we've accepted patches by those users to make it build on platforms without native 64-bit CAS.

Re: Fish 4.0: The Fish of Theseus

#75

Earlier quoted context omitted.

Switching between OSes is a hassle. Besides WSL already has all the loveable parts of Linux, there isn't much point in dual booting anymore

If you’re using WSL, why use Cygwin?

To avoid using cmd.exe/PowerShell for stuff that needs to run natively. For example, when I used Linux I'd use this very small program named darkhttpd for sharing files among my computers over WiFi; when I switched to Windows I compiled it on Cygwin and it worked just as fine.

Re: Fish 4.0: The Fish of Theseus

#77

I use the shell a lot every day, mainly bash and some ash (alpine). Does something like fish make the experience a bit smoother? is it pretty easy to get into?

fish is intended to be beginner friendly, whether you're new to the commandline world or not. It's essentially configuration-free, so that's about as easy to get into as you might imagine.

Re: Fish 4.0: The Fish of Theseus

#78
post #11

I remember switching from bash to zsh a few years back and thinking I was the bees knees. After the switch trying other shells seemed like bike-shedding because, I mean, what more could a shell? Then I got a new computer and decided to start from scratch with my tooling and downloaded fish. I was shocked how it instantly made zsh feel cumbersome and ancient . Heartily recommend others give it a try as a daily driver…

Interesting, I went the other way about 7 years ago - switched from fish to zsh (initially with oh-my-zsh). The interactive experience was similar enough on both shells, and the performance was great on fish and okay-ish on zsh, but two things won me over: 1. With zsh, I can copy-paste some bash snippet and in 99% of cases it will just work. Aside of copy-pasting from StackExchange, I also know a lot of bash syntax b…

Reading the associated issue (https://github.com/fish-shell/fish-shell/issues/510) about the lack of "set -e" was interesting as it highlighted how weird Bash, and shell scripting in general, is from a programming language perspective. Imagine programming in any other environment where every function you call could either succeed or fail catastrophically. There's some talk about adding exception handling to Fish, but maybe the sensible thing to do is to have a mode where Fish ensures that you've dealt with each possible error before moving on. Which is what you would do anyway if you were invoking external programs from a non-shell language (like Python's subprocess.check_call).

In any case the discussion in that issue made a convincing (to me) argument that if you're doing the sort of scripting for which "set -e" makes sense, which is most of it, you should be using Bash. That doesn't mean you need to use Bash interactively though, as others have pointed out.

Re: Fish 4.0: The Fish of Theseus

#79
post #78

Earlier quoted context omitted.

Interesting, I went the other way about 7 years ago - switched from fish to zsh (initially with oh-my-zsh). The interactive experience was similar enough on both shells, and the performance was great on fish and okay-ish on zsh, but two things won me over: 1. With zsh, I can copy-paste some bash snippet and in 99% of cases it will just work. Aside of copy-pasting from StackExchange, I also know a lot of bash syntax b…

Reading the associated issue ( https://github.com/fish-shell/fish-shell/issues/510 ) about the lack of "set -e" was interesting as it highlighted how weird Bash, and shell scripting in general, is from a programming language perspective. Imagine programming in any other environment where every function you call could either succeed or fail catastrophically. There's some talk about adding exception handling to Fish, b…

> Imagine programming in any other environment where every function you call could either succeed or fail catastrophically

There's not much to imagine since that's pretty much every other language?

Sure you can recover with error handlers (sometimes[0]), but by default all of them will hard abort in case of exceptions.

In our modern language landscape shells are very much the odd ones, where errors are completely silent by default and the thing just carries on oblivious that the world around it might be crumbling completely.

[0]: https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-...

Re: Fish 4.0: The Fish of Theseus

#80

I use the shell a lot every day, mainly bash and some ash (alpine). Does something like fish make the experience a bit smoother? is it pretty easy to get into?

I have to ssh into different places quite frequently and keeping the zsh configuration synced was a pain. Fish had 95% of what I needed out of the box so rather than putting a ton of scripts in place, installing omz, plug-ins etc, I run a single install command.
Post reply on HN