32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions
comment 1y ago · link · parent
That said, you asked so here's the result of the difference within the `src/` directories comparing 3.7.1 and 4.0 beta (so excluding docs, fish scripts, etc):
> cd fish3/src; find . -type f -exec cat {} + | tr -d '[:space:]' | wc -c
2172330
> cd fish-shell/src; find . -type f -exec cat {} + | tr -d '[:space:]' | wc -c
2207996
That's an increase of 35,666 bytes, or just 1.6%If you don't exclude whitespace, the difference is just under +250k bytes (an 8% increase).
comment 1y ago · link · parent
We technically removed the last C++ code from the core project in January 2024 (~a year ago), the last C++ code altogether (a test helper) in June 2024 (six months ago). We only decided to push out a release now because we've added enough new features (not counting the rewrite as a feature) to warrant a release.
But at the same time, someone could argue that the current codebase is still far from being fully idiomatic rust, there are various C++-isms ranging from the use of UTF-32 (historical from the nature of std::wchar/std::wstring under *nix) to still passing around file descriptors rather than rust `File` objects (that will take a lot of rearchitecting to make mut-safe).
Ultimately, a project is never "done" and we're not being paid at all let alone contingent upon completion of the port, so there's no real use in saying it took precisely this long or that long. We're releasing now because we want to, but I wouldn't tie the release cadence with the port timespan.
comment 1y ago · link · parent
One thing about rust is that it has always treated cross-compiling as a first-class citizen. Cargo is very intentional about the difference between the HOST and TARGET triplets and you can't mix them up unless you are doing so intentionally.
The rsconf feature detection crate was similarly designed with cross-compilation in mind from the start and eschews running binaries in favor of some clever hacks to exfiltrate values during the cross-compilation process.
There is only one rsconf feature (retrieving compile-time constants) that is currently labeled caveat emptor as it does not support cross-compilation; perhaps I can nerdsnipe someone here into figuring out a workaround: https://github.com/mqudsi/rsconf/issues/3
comment 1y ago · link · parent
comment 1y ago · link · parent
We don't recommend oh-my-fish for various reasons, but I guess what's really missing is just a gallery.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
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?
comment 1y ago · link · parent
We never considered releasing anything with a hybrid codebase; aside from the philosophical purity of fully making the switch to rust, it would have been a complete distribution nightmare (we take package maintainer requirements very seriously). Moreover, the code itself was not in a very pretty state - the port was very much like trying to undo a knot: you had to make it much uglier in order to get it properly undone. There were proverbial tons of SLoC that were introduced only for transitional interop purposes that were later removed, this code was never held to the same quality standards (in terms of maintainability; it was still intended to be bug-free and required to pass all our unit and integration tests, however).
As mentioned in the article, we prefer to do feature detection when and where needed/possible. The old codebase was purely feature-detected via the CMake build system but we ended up writing our own feature detection crate for rust invoked via build.rs (maintained here [0]) though we just defer to libc on a lot (which doesn't do that yet). One side effect of the libc issue is that we're beholden to their minimum supported targets (though I'm not sure if that's strictly the case if we don't use the specific apis that cause that restriction?), which are higher than what we would have liked because we were fine with feature detecting and implementing using both older and newer apis where needed.
comment 1y ago · link · parent
I don’t like the “feel” of the new Windows Terminal “app” but it is more “modern” and “capable” (running a newer conhost under the hood).
But if you’re willing to use non-standard software then WezTerm, Alacritty, and Kitty (WSL with an XServer) are all good options.
comment 1y ago · link · parent
We just ported fish from C/C++ to rust and the amount of semantically unsafe operations a shell does (eg passing around file descriptors instead of a File object that can only have a single mutable reference unless you want to place it in a lock) and the onerous requirements of OS internals that require the use of only async-safe methods in signal handlers and post-fork/pre-exec (which is hard/impossible to do correctly if you’re using high-level wrappers) are quite something.
C is probably the ideal language for a basic shell, which should come as no surprise as OS and libc functionality to make that happen was co-developed.
comment 1y ago · link · parent
Also might want to coalesce https and http
Not sure if it queues jobs for processing so that when I refresh after a failure it is continuing where it left off or if it is starting over anew? “Progress bar” makes it hard to say.
Aside: I dislike the “modern progress bar” that’s just a scrolling marquee of pithy quips. One of the difficult problems I worked on for a SW project was adding sane progress to a multi-stage backup tool so that the completed percentage and ETA correctly represented a mix of millions of single kb files and random multi-gb files, backed up across multiple pipelines on multiple cores, asynchronously piping from one stage to the next with buffering. Needed to add a good progress metric without poisoning cpu core caches or hurting the efficiency of how work was being divided. This doesn’t seem as hard by comparison!
Sorry for only having tangentially relevant things to report at this time; still waiting for it to finish with the fish-shell codebase so I can give some good feedback!
comment 1y ago · link · parent
Even if you don’t use message passing to use one thread to perform all updates/writes, it still performs very solidly for many use cases.