Given the potential damage from it, it’s more like saying it can drive while being confident the brake pedal is always the left-most one, because it’d seen it on reddit.
- 0 Posts
- 118 Comments
balsoft@lemmy.mlto
Programmer Humor@programming.dev•You can pry pattern matching from my cold dead hands
1·27 days agothiserror helps a bit with conciseness. But it’s still the most annoying part of writing Rust for me, even more annoying than async closure capture semantics, and one that I happily offload to deepseek whenever I have to write it. I was even thinking of making some insane proc_macro that would traverse a function and extract the list of all
?, deduce the types, and come up with the final error type (maybe with some hints). But this turned out to be too difficult for a weekend project and ain’t nobody wants to pay me to write it.Type-safe: can’t beat errors as enum values wrapped in Result.
I’m talking more about the
anyhow-style here. It’s not very type-safe.Composable: i don’t think you can beat rust enums in composability.
Well, thiserror-style enums are composable-ish, but they can be too structured for their own good. Sometimes you want only a particular property of an error (e.g. one of the HTTP requests returned 429 or something), and don’t care about the particular branch of the call tree it came from. Rust doesn’t really have the compile-time flexibility to write such a check without a ton of boilerplate that will also break once the call tree changes.
balsoft@lemmy.mlto
Programmer Humor@programming.dev•You can pry pattern matching from my cold dead hands
1·27 days agoI am well aware, I wrote quite a lot of Rust, including professionally. I’m not necessarily talking about the “clear happy path”, even though that is relatively nice to have (Rust sort-of allows that with the
?sugar and the pseudo-functor and pseudo-monad methods on wrappers); I’m talking more about the fine line between the overly verbose lists of all the errors that a function could produce (thiserror-style) or just a single messy error type that makes error handling difficult (anyhow-style). There surely must be something in between there that is concise, type-safe, and composable, but I haven’t seen it in any language yet.
balsoft@lemmy.mlto
Programmer Humor@programming.dev•You can pry pattern matching from my cold dead hands
412·28 days agoSadly there’s still no truly good way to handle errors in rust. TBH I’m not sure if we as an industry have figured out an efficient, foolproof, composable, not overly verbose way to handle errors, so it’s not entirely on Rust.
balsoft@lemmy.mlto
Ask Lemmy@lemmy.world•How, exactly, does one make a living as a mathematician?
2·29 days agoIn the very old times, you’d have to be born rich already to do maths. You then don’t concern yourself with making a living, because your slaves do it for you.
In the old times, you’d live the same as artists: find a rich dude (exceptionally rarely: dudess) to pay your bills, and in exchange name shit you discover/invent after them.
Last few decades you also have a couple new options. You can work (teach) at a university for pennies, and typically have a second job/side hustle so that you can actually survive. And/or you can write books/make a YT channel, and if you’re lucky and get popular enough, that can be your living then, but it’s probably not going to be anything too advanced. And/or, if your area of expertise has some vaguely practical application (e.g. cryptography or statistics), you can actually find a job that pays you to do theoretical research in that area in hopes of finding practical application, but you’d have to be pretty lucky to get that.
Nah, social division of labour is almost as old as civilization itself. It’s not possible to do everything by yourself, if you’re lucky enough not to die of hunger in a few weeks, you’ll die of a preventable disease within a few years.
Capitalist exploitation of it (combined with faux individualism) is the issue.
Translating to this scenario, there would be no issue if we had community kitchens with cheap/free food and well-paid workers. The issue is the capitalists extracting surplus value from a basic necessity, partly by convincing everyone to hate their neighbours and eat alone.
balsoft@lemmy.mlto
Showerthoughts@lemmy.world•There should be a "last used combination" faucet handle for sinks so you don't have to balance hot and cold everytime during winter
1·2 months agoActually, fuck yeah. My parents also have one of those bad boys:

It’s really nice to bathe in!
balsoft@lemmy.mlto
Showerthoughts@lemmy.world•There should be a "last used combination" faucet handle for sinks so you don't have to balance hot and cold everytime during winter
1·2 months agoOh, yeah, that makes much more sense actually. Now I kinda want that setup, but I bet it’s expensive.
balsoft@lemmy.mlto
Showerthoughts@lemmy.world•There should be a "last used combination" faucet handle for sinks so you don't have to balance hot and cold everytime during winter
2·2 months agoThat’s still confusing to me. My parents had the water heater tank in the bathroom, between the shower/bath and the sink. The kitchen sink had a separate small water heater.
balsoft@lemmy.mlto
Showerthoughts@lemmy.world•There should be a "last used combination" faucet handle for sinks so you don't have to balance hot and cold everytime during winter
121·2 months agohot water circulation systems should be more common
That just sounds like a waste of energy. Why not have the water heater right next to your shower, so that there’s no wait? It’s how it was set up in my parents home. Really enjoyed that setup, never had to wait for hot water.
balsoft@lemmy.mlto
Programmer Humor@programming.dev•All modern digital infrastructure
26·2 months agoIt was used to deliver the comic to you in the first place.
The intended use-case is for bit-banging, i.e. sending electricity to places according to certain algorithms. Think about simple automation, like the control chip in your washing machine which executes the selected program by sending enable/disable signals to the water pump, valves, and the motor. Well, the same basic principles could apply to a lot of industrial processes and such, helping us rebuild the civilization.
It would also be really fucking great for helping post-collapse engineers do various calculations. Those chips are really slow by modern standards, but insanely fast compared to an abacus, a slide rule, and a sheet of paper.
BTW there’s also dusk OS, which follows similar principles but is targeted for more advanced hardware, like the abundant x86 and ARM chips. It has a way more user-friendly interface, a basic GUI, filesystem drivers, and IIRC even networking capabilities, all possible to run on a PC from the early 90s. It also has great bootstrapping flow, allowing you to rebuild itself from source, flash itself to other computers, and flash Collapse OS onto microcontrollers.
Basically like a Linux install with all the dev-tools and sources already there, except much simpler, to the point that you probably can figure out how every component of the system works yourself, and fix issues when they happen. This knowledge will also directly translate into writing programs for collapse OS, because they share the programming language and many OS paradigms.
balsoft@lemmy.mlto
Programmer Humor@programming.dev•All modern digital infrastructure
15·2 months agoI like how the rememes of this only get more complicated and less stable with time; hopefully this means the collapse is approaching, or else I’m learning forth for nothing!
It’s like a clown. Funny to watch it goof about from afar, but when it comes to you OH FUCK OH SHIT THERE’S A CLOWN STARING AT ME FROM THE WINDOW AND PLOTTING A RIGHT-WING COUP
balsoft@lemmy.mlto
Programmer Humor@programming.dev•99% of Windows usability issues would be fixed if Windows had the guts to add this button
1·2 months agoThe file that’s in use may not survive.
Yes, but at least the rest of the filesystem will
balsoft@lemmy.mlto
Programmer Humor@programming.dev•99% of Windows usability issues would be fixed if Windows had the guts to add this button
3·2 months agoI’m not too versed in the intricacies of Windows, but I don’t think that’s the case on Linux at least.
There’s a difference between telling the processes to “fuck off” (by using
umount -f) and actually yanking the drive.umount -fwill at least flush the caches to drive, including all filesystem metadata and journaling, while just yanking the drive off will definitely not, and if you’re unlucky you can ruin the FS (especially if it’s not a journaling one). I’ve lost data like that before, been usingumount -fever since.
balsoft@lemmy.mlto
Ask Lemmy@lemmy.world•You have $10,000 to make your town/city a better place to live. What do you do with the money?
3·3 months agoWe actually have two, for both of us to ride on. It’s the main way we get around the city. They cost us ~$80 combined (I’m not in the US tho), plus maybe another $50 in spare parts over the year or so we’ve had them. Also, as a proud 30yo shitbox owner, what’s a monthly car payment?
balsoft@lemmy.mlto
Ask Lemmy@lemmy.world•You have $10,000 to make your town/city a better place to live. What do you do with the money?
1·3 months agoI’m assuming not many suburbanites have bikes.
balsoft@lemmy.mlto
Ask Lemmy@lemmy.world•You have $10,000 to make your town/city a better place to live. What do you do with the money?
31·3 months agoAh yeah, that makes sense. However, if all roads are fully jammed, most people would be able to walk to a grocery store - it’s likely not insanely far away from you (quick search suggests average straight-line distance to a grocery shop in the US is ~4 km = 50 min, which sounds very far away from a non-US perspective but still not completely unreachable), it’s just that usually there’s a highway full of traffic between you and the store.

The functional elitist is actually running Yi in XMonad on Guix.