> 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.
Fish 4.0: The Fish of Theseus
121–130 of 204 posts
Re: Fish 4.0: The Fish of Theseus
#122Congrats 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…
Re: Fish 4.0: The Fish of Theseus
#123Earlier 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.
Re: Fish 4.0: The Fish of Theseus
#124I 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.
Re: Fish 4.0: The Fish of Theseus
#125I 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…
Re: Fish 4.0: The Fish of Theseus
#126I'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
#127We'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
#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.
Re: Fish 4.0: The Fish of Theseus
#129Re: Fish 4.0: The Fish of Theseus
#130Earlier 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`
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.