Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 1y ago · link · parent

So the problem with character counts is that unless you put in an insane amount of effort to calculate it, you're not going to get "significant chars" but rather "bytes"

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

imho starship is really just eye candy for the shell; it's not necessarily an actually improved shell prompt if you're on a "modern" shell like fish (a shell for the '90s!) or if you've put effort into customizing your shell experience with any of the other shells.

comment 1y ago · link · parent

It's actually not fair to judge this one way or the other at the two year mark.

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

IMHO a broken toolchain is a broken toolchain and that's kind of outside the scope of autoconf -- and I say this despite having banged my head against the wall only too many times as a result of an odd toolchain misconfiguration leading me into chasing autoconf gremlins.

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

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

Integration with 3rd party scripts and tools is often a single line in your config.fish, something like `foo --init-fish | source` or better yet, `command -q foo && foo --init-fish | source`

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

We took an incredible amount of care to consider the package maintainer requirements for our the most popular distributions using/distributing fish. One of our maintainers is very careful about letting us know when we're doing something that might upset distro packagers, and we're constantly letting package maintainer guidelines and requirements influence how we structure fish itself and which dependencies we pull in.

comment 1y ago · link · parent

Thanks but one cannot be too ambitious like that! '00s would mean the end of zip drives, dealing with unstandardized flash drives flakier than the floppy disks of old, and supporting point-and-shoot digital cameras!

comment 1y ago · link · parent

We've actually added support to make single-binary fish deployments possible by (optionally) bundling static resources that would be part of the CMake-based deployment into the binary itself and having it unwrap those on first execution. The limitations of Cargo and the idiomatic `cargo install` usage primarily motivated this.

comment 1y ago · link · parent

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?

comment 1y ago · link · parent

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`

comment 1y ago · link · parent

FWIW, fish is much more bash-compatible these days. We've introduced support for a lot of bash-isms that don't completely break the fish spirit or clash with its syntax in the last few releases.

comment 1y ago · link · parent

To clarify, work on the rust rewrite started after 3.7.0, but the C++ code remained in a working branch on the git repo. Midway through the rewrite, we backported additions and improvements to fish scripts (most observable being new and improved completions) and a couple of important bugfixes from the rust-containing `master` branch to the C++ branch and released that as 3.7.1.

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.

[0]: https://github.com/mqudsi/rsconf

comment 1y ago · link · parent

Thanks for (possibly) vindicating my memory! I recall seeing this circa 2010 +/- a year or so.

comment 1y ago · link · parent

Urxvt causes(d) my laptop running Ubuntu to sporadically but spontaneously power cycle, presumably due to bugs in the graphics drivers. Iirc it happened under Nvidia and Intel.

comment 1y ago · link · parent

> You’d need to have builds GTK4 & QT

Isn’t this just a long about way of saying “no”? Very few frameworks let you flip a switch and build against Qt OR Gtk.

comment 1y ago · link · parent

I ditched putty a long time ago. Conemu is better than putty these days (latest Windows 10 or Windows 11 if you’re unlucky enough).

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

Do we have two completely different definitions of “infrastructure”?

comment 1y ago · link · parent

Writing a shell in C is in some ways easier than writing a shell in a higher language.

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

(2014)

I remember seeing this when it was first making the rounds (though I thought it was earlier than ‘14, but that’s what all the press links date to). Incredible.

comment 1y ago · link · parent

Bug: url checker is case sensitive. For those of us that type out the url from memory on a stupid touch-type device with auto incorrect, you’ll get things like Http(s)://Github

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

5 acres is literally an oversized backyard.

comment 1y ago · link · parent

The post mentions that ϖ is called “varpi”; I just wanted to add that this is actually short for “variant of pi”, also known as an “archaic form of pi” from old Greek writing.

comment 1y ago · link · parent

This is a baseline benchmark I published of various p9x latencies for multiple readers/writers with a single SQLite database with different configurations set: https://github.com/mqudsi/sqlite-readers-writers

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.

comment 1y ago · link · parent

Same restriction with cuckoo filters. Are there any better than bloom filters without this restriction?

comment 1y ago · link · parent

So is this a "serverless" named-pipe-as-a-service cloud offering? Or am I misreading?
1
192021
277