32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions
comment 3y ago · link · parent
Obviously basic component activation is functional otherwise the shell wouldn't function (my biggest problem with WinRT/UAP: its insidious creep into the OS "internals" rather than just powering apps, widgets, add-ons, whatever on top of the base system), but I'm not sure how many apps you might pick at random from the app store will still work.
comment 3y ago · link · parent
I can get a fully functionable desktop with GUI apps, generic hardware support (i.e. not locked down to my hardware), support for dynamic modules/drivers/libraries, audio, 3d-accelerated video, and more in a 300 MiB footprint (with only basic iso image compression) and runnable with 128 MiB of RAM.
Then comes in the last part of your statement: "do some very basic web browsing." The system above works just fine with a browser featuring < 201x tech, with great CSS, JS, HTML support. But if I need to build and bundle the latest Firefox, Chrome, or whatever without manually stripping out a ton of features (beyond what is available via distro package managers), that footprint triples or quadruples in size and the memory requirements skyrocket.
comment 3y ago · link · parent
I think certain team members have individually gravitated towards rust over the years, probably each for reasons of their own. Peter is the driving force behind this commit (I don't think anyone else would have ventured to open this PR and would probably have launched a rust fork as a side project instead) and I've been seeing him publicly state his evolving opinion on rust over the years. He's thorough and methodical and certainly not prone to seismically shaking up the codebase on a whim or because of a RIIR comment made in passing; I think it probably just reached the point a lot of others that maintain other projects have reached in the past, where the appeal of porting it to a (hopefully better) language reaches a tipping juncture that makes it worth entertaining.
Personally, every time I delve deep within the internals of fish's legacy codebase I just come away increasingly frustrated with how much of what I'm doing is battling the language or working around its warts rather than working on what I really want to be doing. We've spent too many man hours to count porting concepts like Option<T> and friends over to take advantage of the hygiene and correctness they lend to codebases. I most recently spent forever working out a CoW string, then didn't have it in me to actually merge the branch because of how much churn it would probably entail.
But back to your question - I feel like most "why don't you rewrite it in rust" questions can generally be dismissed almost entirely out of hand because they're made in passing by people with no stake in the project who have no idea what that would entail, what it would look like, and at what cost it would come. The only people I ever spoke to seriously about that were other core maintainers, and there are very few outside that pool whose opinion I would personally attribute any weight to on a question like that.
comment 3y ago · link · parent
1. That's the primary concern I have right now. There's only so much bandwidth the team has to work on new features, bug fixes, and a rewrite port. Anything that requires cross-compilation-unit changes C++ side will probably be "that" much harder to do, or at least it'll add "that" much more friction to doing so. The pace of fish development isn't breakneck by any means, but it's still going to be something to keep in mind.
The currently suggested module-by-module approach is a fairly good compromise (relying on FFI to bridge between the port and the original code), though it does mean that changing any "core" shared structure is going to have to be done twice (or three times, if you count C++ headers vs impls). If we elect to have a cpp-only 3.6.x around for some period of time receiving backports (maybe just completions, critical breakage, and security fixes?) that would of coures be yet another thing to keep in mind.
I think this is probably going to be the most important question for the team to work out an answer to in the linked PR, with feedback from the community.
2. This is complicated by the fact that there really isn't much motivation to keep two versions of fish chugging along (possible cpp-only short-term branch excluded). The team is small, a greenfield rewrite of the project (rather than a port) is ill-advised due to the number of niche compatibility and quirk workarounds in fish core, and if you magically had a feature-parity rust port of fish available, I don't think anyone would really want to keep hacking away at the cpp version indefinitely. Fish never really saw great uptake as a scripting language (core fish devs are probably the only ones that have "fish scripts" tens of thousands of SLoC long) so it's just the "main interactive project" and the spec is "whatever the version of fish most used by our users currently does." It would probably be as much effort to define (other than via code and tests) "the fish spec" than it would be to rewrite or port it to rust in the first place.
My greatest personal loss would be the nostalgia of running fish on systems that are truly from the 90s (as fish's once-serious now tongue-in-cheek slogan is "finally, a command line shell for the 90s"). But that might be a small price to pay for greater correctness, better maintainability, and more idiomatic code that's more welcoming to passing-by contributors.
comment 3y ago · link · parent
Archived copy: https://archive.is/ZrbgR
comment 3y ago · link · parent
(And I say this as someone that's at least passably familiar with go and have worked on/contributed to golang projects in the past.)
comment 3y ago · link · parent
However, I must say that I actually prefer the pictures of the scope to the "raw graphs" you posted. Maybe it's just because I'm familiar with them but I find the oscilloscope pics to be much more legible and more immediately understandable than the b&w images you posted, possibly because their lines aren't as bold and clear.
I'd just use something like the Lens app by Microsoft on my phone to take the picture and automatically deskew, rotate, and crop.
comment 3y ago · link · parent
(Ironically yesterday was the first time I had trouble with my Postscript printer configured to always download soft copies of fonts from the PC; I was printing in Arabic from MS Word and the printer was making the strokes so bold all the letters connected. Converting to a PDF and printing from Adobe did the trick.)
comment 3y ago · link · parent
If you don't mean "in its spec" but "in practice, as written and most commonly used" then the pthread mutex fits that definition, at least under Linux, as noted in a footnote in the article:
> You can see a sample application testing for pthread_mutex_unlock() safety
> here [0] and try it out for yourself online here [1].
[0]: https://gist.github.com/mqudsi/5aac71d8177866ba2762bda01a3ff...
[1]: https://onlinegdb.com/9hmNhBuEc
You can literally use it as a binary semaphore, but I can't think of a good reason to do so since pthread semaphores are signal safe while pthread mutexes aren't (which is why many people do the opposite).
The only way it can not work that way is to keep track of the owning thread id, which it elides as an optimization and trusts the caller to "use it wisely" instead.
Using PTHREAD_MUTEX_ERRORCHECK instead of PTHREAD_MUTEX_NORMAL (which pretty much every platform I've seen defaults to as the value of PTHREAD_MUTEX_DEFAULT) causes that to fail, but when's the last time you ran into a project using PTHREAD_MUTEX_ERRORCHECK? (PTHREAD_MUTEX_RECURSIVE technically has the information required to also validate the unlocking thread, but I haven't tried to see if does in practice.)
comment 3y ago · link · parent
Blocks until n threads or n tasks have completed. Latter is useful in a threadpool context.
comment 3y ago · link · parent
https://neosmart.net/blog/2022/implementing-truly-safe-semap...
comment 3y ago · link · parent