Live data from Hacker News

Fish 4.0: The Fish of Theseus

fishshell.com

121–130 of 204 posts

Re: Fish 4.0: The Fish of Theseus

#121

> Fish also uses threads for its award-winning (note to editor: find an actual award) autosuggestions and syntax highlighting, and one long-term project is to add concurrency to the language. (note to editor: find an actual award)

Seriously, can someone find them an award? I think they've earned it.

Achievement unlocked: Centurion! _get over 100 comments on hacker news_

Re: Fish 4.0: The Fish of Theseus

#122
post #8

Congrats to the fish team! Great writeup with lots of interesting detail. I wonder if this is the biggest project that has moved from C++ entirely to Rust (or maybe even C to Rust?) It probably has useful lessons for other projects. If I'm reading this right, it looks like fish was not released as a hybrid C++ / Rust program, with the autocxx-generated bindings. There was a release during that time, but it says "fish…

[deleted]

Re: Fish 4.0: The Fish of Theseus

#123

Earlier quoted context omitted.

Is the “foo.fish” name required? Could I have “bar.fish” with “function foo…” inside and still autoload function foo?

Not autoload, no. You can have as many functions as you want in a single .fish file, but it'll only be lazily autoloaded if it has the same name as the command you are trying to execute. It's how we avoid doing the I/O of scanning all fish directories and parsing their contents at startup.

...and you can still explicitly source the files if you want to load the functions elsewhere.

Re: Fish 4.0: The Fish of Theseus

#124
post #86

I am curious to ask others here, are there other low-config alternative tools like Fish that, looking back, now seem like a no brainer? Ghostty is a recent example, Helix seems like another. I’d love to know about other tools people are using that have improved or simplified their lives.

fastmod is a better sed.

Re: Fish 4.0: The Fish of Theseus

#125
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…

Same here. I used it for about 3 days before I installed it on all my systems and permanently switched. For me, it was like the first time I learned a non-Latin language, and my eyes were opened to how much stuff I took for granted was completely arbitrary. For example, here's how you write an autoloaded function "foo" in Fish: you make a file called "foo.fish" in its config directory. Inside that, you write "functio…

This was more convincing to me than the GP comment, especially the shell prompt part.

Re: Fish 4.0: The Fish of Theseus

#126
We're flush with new and awesome terminals lately, Ghostty public launch now a huge upgrade to fish.

I've tried Fish a few times but hard to migrate over from bash/zsh. Does anyone have tips on how to port over a bunch of aliases/scripts/etc. easily?

Re: Fish 4.0: The Fish of Theseus

#127

We're flush with new and awesome terminals lately, Ghostty public launch now a huge upgrade to fish. I've tried Fish a few times but hard to migrate over from bash/zsh. Does anyone have tips on how to port over a bunch of aliases/scripts/etc. easily?

You don't need to port your scripts. Migrating aliases shouldn't be too difficult.

Re: Fish 4.0: The Fish of Theseus

#128

> it is often better to use if cfg!(...) instead of #[cfg(...)] because code behind the latter is eliminated very early My experience with this is the other way around, especially if you have crates tied to that feature. The cfg! is a marco that compiles to true/false, so whatever is inside of the if guard needs to compile regardless. E.g.: Cargo.toml [features] default = [] my_feature = ["deps:feature_dependency"] […

I might be wrong but most optimizing compilers will treat "if false" and the following code as dead and remove it.

It will remove it, but not until after resolving symbols. If the branch-never-taken references a missing library then this will still error, which is the problem for a feature flag.

Re: Fish 4.0: The Fish of Theseus

#129
Thought for a second that this was a 4.0 release announcement but this is just about the rewrite in rust. Any fish users wanting release notes of what to look forward to can look here: https://fishshell.com/docs/4.0b1/relnotes.html. Glad the rewrite is helping the dev team make improvements, but I’m more excited for the actual new features (except the new alt-backspace behavior which I’m sure I’ll get used to).

Re: Fish 4.0: The Fish of Theseus

#130

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`

That assumes you care about portability. Not everybody does.

Writing portable software is difficult, and doing it for shell scripts even more so. Blindly pursuing portability for its own sake is not worth it. Weigh the cost of portability against the odds that the software will ever run on different systems.

For me personally it is never worth it to write my personal programs portably. This would require that I test them on different systems that I do not even use. Pointless.

Post reply on HN