- 0 Posts
- 75 Comments
A minimal but powerful language can feel like magic. Like, literally. The whole appeal of magic in stories is that you can step out of the normal rules and do something that defies belief, and who hasn’t fantasized about that in real life?
If the language you’re using has a lot of magic built into it, things that the language can do but you can’t do, you feel mundane, like the language is letting you look at the cool things it can do, but doesn’t let you do them yourself. A more minimal language, where the important things are in the library, means that the language designers haven’t kept that stuff to themselves. They built the language such that that power is available to everyone. If the language gives its standard library authors the power to do things beautifully and elegantly without special treatment, then your library is getting those benefits too.
It’s also a sign of good design, because just saying “well, this thing magically works differently” tends to be a shortcut, a hack, an indication that something isn’t right and couldn’t be fixed nicely.
It doesn’t have to be a big baroque thing. When there’s a dotfile I configure regularly, I move it to a Git repo and use
stowto put it “back” into place with a symlink. On new machines, it isn’t long before I try something that doesn’t work or see the default shell prompt and go “oh yeah, I want my dotfiles”, check out the repo, run a script that initializes a few things (some stuff is machine-specific so the script makes files for that stuff with helpful comments for me to remember the differences between login shells or whatever) and then I’m off to the races.
chaos@beehaw.orgto
Programmer Humor@programming.dev•Op doesn't have time for interviews
6·3 months agoHint: the solution depends on a more realistic and physics-based model of the problem than you’re using. And, even bigger hint, it’s less intuitive now that light bulb technology has changed to become much more efficient, you should imagine this problem taking place with a '90s bulb.
chaos@beehaw.orgto
Programming@programming.dev•[bash][git] Can I make a git hook exit before the command exits?
5·4 months agoI don’t understand why this works, but it does
What was happening before was this: Git received your commits and ran the shell script. It directed the script’s output stream back to Git so that it could relay it back over the connection to display on your local terminal with
remote:stuck in front of it. Backgrounding thenpxcommand was working, the shell was quitting without waiting fornpxto finish. However, Git wasn’t waiting for the shell script to finish, it was waiting for the output stream to close, andnpxwas still writing to it. You backgrounded the task but didn’t givenpxa new place to write its output to, so it kept using the same output stream as the shell.Running it via
bash -cmeans “don’t run this under this bash shell, start a new one and have it just run this one command rather than waiting for a human to type a command into it.”The & inside the quote is doing what you expect, telling the subshell to background this task. As before, it’ll quit once the command is running, as you told it not to wait.
The last bit is
&> /dev/nullwhich tells your original, first shell that you want this command to write somewhere else instead. Specifically, the special file/dev/null, which, like basically everything else in/dev/, is not really a file, it’s special kernel magic. That one’s magic trick is that when you write to it, everything works as expected except all the data is just thrown away. Great for things like this that you don’t want to keep.So, the reason this works is you’re redirecting the
npxoutput elsewhere, it just goes into a black hole where no one is actually waiting for it. The subshell isn’t waiting for the command to finish, so it quits almost immediately. And then the top level shell moves on after the subshell has finished.I don’t think the subshell is necessary, if you do
&> /dev/null &I think it’d be the same effect. But spawning a useless shell for a split second happens all the time anyway, probably not worth worrying about too much.
In Haskell, that’s “unit” or the empty tuple. It’s basically an object with no contents, behavior, or particular meaning, useful for representing “nothing”. It’s a solid thing that is never a surprise, unlike undefined or other languages’ nulls, which are holes in the language or errors waiting to happen.
You might argue that it’s a value and not a function, but Haskell doesn’t really differentiate the two anyway:
value :: String value = "I'm always this string!" funkyFunc :: String -> String funkyFunc name = "Rock on, "++name++", rock on!"Is
valuea value, or is it a function that takes no arguments? There’s not really a difference, Haskell handles them both the same way: by lazily replacing anything matching the pattern on the left side of the equation with the right side of the equation at runtime.
The far right loves a strong man, and by definition there can be only one of those, prefers when “the natural order” is followed, and thinks the ends always justify the means. That keeps them pretty cohesive with the establishment right, who are making buckets of money under the system as it is now and are okay with just about anything else as long as that doesn’t change. When they fight, it’s because the far right is trying to do something stupid enough that the establishment thinks it risks their money or power, or the establishment is holding the far right back from fully implementing their “natural order” worldview, but there’s a lot of overlap where both can be happy, because the establishment really has no morals at all and are happy to use the far right to gain power if all they have to do is throw them some red meat every once in a while.
The left’s a very different story. On the far left, people are very principled, to the point where compromise or partial wins feel hollow because the only real win would be the entire principle being adopted en masse. It makes it harder to work together, because even groups with the same goals can get frustrated by the way the other one is doing it, or because the other group is going to keep going while the other wants to stop sooner. And the establishment left has a fair amount in common with the establishment right, they find the right’s goals uncouth and mean, but they do still fundamentally believe in capitalism and don’t want to upend the system. That leaves a lot less common ground and a lot more infighting overall.
I got the .net and .org of my last name, and offered $50 to the owner of the .com as he wasn’t doing anything with it. Kind of a lowball, admittedly, but I would’ve gone up to a hundred or two. Instead, he told me it was worth thousands, which, lol, but then he didn’t renew it, which I only found out because a random third person reached out to me as the owner of the .net offering me the .com. Turns out they hadn’t actually bought it yet, though, so instead I scooped it up and now I’ve got the trifecta!
I’d believe that people are living happy, fulfilling lives there, sure, people usually find a way to do that regardless of their situation. But I’m pretty sure it’s not just propaganda that the same damn family has been in charge for the better part of a century, and that alone is enough for me to conclude that it is a fundamentally broken system that, even if it somehow isn’t as repressive and evil as it’s portrayed, will get there eventually.
This is a good point, we should ask some average North Koreans directly, that way we get a better balance of viewpoints. Maybe we can catch some on a vacation abroad or something.
chaos@beehaw.orgto
Programming@programming.dev•Code comments should apply to the state of the system at the point the comment “executes”
6·6 months agoThe best, clearest code in the world will make it perfectly clear exactly what’s going on, but not why. “
database.fetch(); // Fetch from the database” is a terrible comment, sure, but “// Resource loading is done lazily on first run, so we cannot depend on it being available right away” is something that can’t be conveyed through code alone.
chaos@beehaw.orgto
Asklemmy@lemmy.ml•Human em dash users, are you still afraid of being mislabeled as "AI"?
2·6 months agoYes, but most human em dashes are from writing going through relatively professional processes, not, say, writing a comment online. Of course, there are many — like myself — who know how to type them quickly, and choose to use them, but LLMs are definitely a lot more eager to use them than the average person.
chaos@beehaw.orgto
Linux@lemmy.ml•Ubuntu 25.10's Move To Rust Coreutils Is Causing Major Breakage For Some Executables
81·6 months agoMaybe I’m missing something, but I’m not sure what the worst case scenario is… like, is some company going to get rich off of their proprietary
cpandsudoimplementation that they forked off of an open one?
chaos@beehaw.orgto
Technology@beehaw.org•Comcast Executives Warn Workers To Not Say The Wrong Thing About Charlie Kirk | 404 Media
21·6 months agoThat “unacceptable and insensitive” comment was, in reality, an entirely reasonable take on how Charlie Kirk directly stoked the fires that ended up taking his life. They’re sending a clear message that you are not allowed to speak honestly about any of the context surrounding the event, and can only share an opinion if it shows Kirk in a positive light, since apparently neutral or worse is not allowed.
chaos@beehaw.orgto
Programmer Humor@lemmy.ml•i love ai in my offline foss softwares that are still in beta
2·6 months agoFor most software, iteration starts getting diminishing returns only if it’s approaching feature completeness and no bugs. LLMs are plateauing well before they became super genius job stealers like they were supposed to, and it’s going to take a major breakthrough to see any significant improvement.
chaos@beehaw.orgto
Technology@beehaw.org•They thought they were making technological breakthroughs. It was an AI-sparked delusion.
5·7 months agoThose images in the mirror are already perfect replicas of us, we need to be ready for when they figure out how to move on their own and get out from behind the glass or we’ll really be screwed. If you give my “”“non-profit”“” a trillion dollars we’ll get right to work on the research into creating more capable mirror monsters so that we can control them instead.
chaos@beehaw.orgto
Technology@beehaw.org•Midjourney's troubles get worse as Warner Bros Discovery sues the AI image generator for copyright infringement
16·7 months agoFan art is generally protected because of a rule called “fair use”, which allows people to use copyrighted work without permission. For example, if you briefly quote a book, the author won’t have success if they go after you for copying from their book, even though you clearly did. Generally speaking, a person making fan art and not selling it is going to be protected under fair use. The law wants creators to have control of the thing they created, but we all live in a shared culture and we all deserve to participate in the art we experience, so there’s some wiggle room, and this has been the case long before AI was a thing.
What these AI companies are doing, on the other hand… well, it hasn’t really been tested in court yet, but they’re doing a lot more than single images or brief quotes, and they’re doing it for money, so they’ll likely have some work to do.
chaos@beehaw.orgto
Memes@lemmy.ml•Amerikkka land of the jailed (But China is defo AuThOrITarIAn!!)
1·7 months agoAh, I didn’t see that edit, apologies, had the page loaded for a while before replying.
Isn’t that the same leverage that the earliest labor unions used because it was all they had? It seems to fit very well, actually. There’s a smaller but more powerful group in charge of them, workers get little to no direct say in company policy or who they are managed by and have to hope they’re listened to when asked how things are going. There certainly isn’t a second C-suite waiting in the wings to be put into power if the first one disappoints, the current powers-that-be would be insane to allow something as chaotic as that. If the CEO’s got a good track record of listening, the pay’s pretty good and satisfaction is high, and they’re kept in line with picket lines when it’s necessary, is this company an extension of the working class like China’s government is?
I’m comparing and contrasting quite a bit with my new job, which fits much more closely with what my idea of something worker-controlled would be. It’s fully employee owned, so profits go either back into the business or into our pockets as bonuses. There’s as little hierarchy as possible, the closest thing to a manager isn’t ever going to “put” you on a project, you’re free to find one that you like and wants you to join. Company decisions involve everyone equally, and there’s freedom to loudly speak your mind about policies and procedures if you disagree with them. That’s closer to the country I’d want to live in, not the one where my influence is akin to answering corporate surveys and getting to choose which of 3 approved managers I want to work under, or go on strike if I’m really not happy.
chaos@beehaw.orgto
Memes@lemmy.ml•Amerikkka land of the jailed (But China is defo AuThOrITarIAn!!)
1·7 months agoRight, that’s a good example of it going the way you describe, and I’m curious what would’ve happened if the government hadn’t folded. If the people really are making the decisions, they would get their way eventually, what does that look like?

My guess is they didn’t want to route the cable around all the VMU stuff internally, so they just had it come out the bottom instead. There was a little divot that you could clip the cable into that pointed it forward if it really bothered you, but it really made no difference either way.