News for hackers. Stuff that matters.

tickettotranai

Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @08:11PM (#45599985)
If someone paired this with a code-lite GUI designer, the world would be a brighter place indeed
Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @08:04PM (#45599924)
(rewrote this to be less insufferable)

It's not about saving a single return statement, even in the elvis case. How many times have you written code along the lines of "if this isn't null do this, otherwise return. If the result of that isn't null, do this, otherwise return" etc etc.

Elvis ops are a small QoL change, Promises are essential to async Exceptions (much of the time) are kind of a "catch it pass it on" logic for me, and man do I wish I didn't need to write it every time.

With networking this really shines, or really just anything async etc

Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @07:58PM (#45599881)
No I believe he's basically formally correct.

You need to be able to "wrap" values and then also "wrap" functions in the way you expect. That's literally it.

Btw, the list monad example is stupid imo and borderline misleading. The promise/nullable/Either examples are better. you "wrap" a function by putting it as the only value in a list, and "map" pretty much acts as your function wrapper, but technically this you need to jump through a couple hoops to make it monadic, and I'm just not sure the metaphor is helpful here

Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @07:42PM (#45599733)
Somehow I hear this all the time, but the haskell people have to realize that code patterns are absolutely a thing in all languages, ever? A lack of syntactic sugar doesn't mean monads don't exist in other languages.

Typeclasses are a distraction, the point is computation ignoring annoying contexty stuff (file not found errors, null on failure, etc) and there's dozens of examples in literally every language ever.

Not all problems are solved with a technical definition.

Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @07:38PM (#45599688)
no, you do not.
Re:Monads are too powerful: The Expressiveness Spectrum on Wednesday October 15, 2025 @07:33PM (#45599639)
Like many things in life it is far easier to give examples than it is to describe the thing.

Examples of monads are Promises and Elvis operators (for values that can be nullptrs). In a sense exceptions as well. Having heard this I think if you do a second pass at the type definitions, I think you may be able to parse them out

It really is just "a wrapper for values that sticks around when you do something to the values".

Think of it as a coding pattern, and it's much easier to grok

It's handy for IO because, well, did you see the examples I gave? A monad lets you basically ignore the failure mode/weirdness (the async stuff in the context of promises, null type in the case of Elvis) and worry about the computation you actually want to be doing.

Other places you might apply these would be fileio (file not found? cool, don't care, deal with it later) or networking (as long as the connection's good, do this.)

Re:Why Today's Python Developers Are Embracing Type Hints on Sunday September 28, 2025 @07:43PM (#45409060)
I mean, you can just... Not annotate something if creating the relevant type is a pain. Static analysis \= type hints, and even then...

Besides, there must be some behavior you expect from this object. You could make a type that reflects this: IntIndexable or something, with an int index method and whatever else you need.

This feels like an extremely weak argument. Just think of it as self-enforcing documentation that also benefits auto-complete; what's not to love? Having an IntIndexable type seems like a great idea in your use case.

Re:Building the mouse Logitech won't make on Monday August 25, 2025 @05:42PM (#45019393)
I counter by asking if renting them would have saved you money. It's what I do when I need tools I don't usually use
Re:LLMs Aren't World Models on Sunday August 10, 2025 @04:36PM (#44858087)
Technically yes, but... it's moderately tricky to get an LLM to play good chess even though it can.

https://dynomight.net/more-chess/

This is significant in general because I personally would love to get these things to code-switch into "hackernews poster" or "writer for the Economist" or "academic philosopher", but I think the "chat" format makes it impossible. The inaccessibility of this makes me want to host my own LLM...

Re:Big Tech Killed the Golden Age of Programming on Friday August 01, 2025 @03:44AM (#44754044)
If anything, I take corporate greed as axiomatic. Saying something happened because of it is stupid. There's no information in it.

And hey, look, turns out the article was AI slop generated to make the front page of HN.

Re:Big Tech Killed the Golden Age of Programming on Friday August 01, 2025 @03:41AM (#44754020)
Something can be falsifiable without being false. F=ma is falsifiable but not false. With humanities stuff it's less clear cut, but I'm inclined to be skeptical of ideas that explain too many things.

Falsifiability is relevant because I'm not saying the framing is wrong (I'm not even convinced it can possibly be proven wrong), I'm saying it's not very useful. In practice this has the same effect as me saying that "corporate greed" is axiomatic, so blaming it for things is like blaming water for flowing downhill.

It would be much more productive to frame this as an example, say, of market failure. Or a discussion of short-term thinking, or lacking negative feedback. All would be interesting.

PS: the author has now stated his post was AI slop written to make the front page of HN. I feel extremely validated.

Re:Big Tech Killed the Golden Age of Programming on Wednesday July 30, 2025 @11:29AM (#44735519)
If your framing is unfalsifiable, I question its utility.
Re:Blender: Beyond Mouse and Keyboard on Monday July 28, 2025 @11:49AM (#44712029)
Blender is nothing like chromium. It's not made by a big company, it sprung up in an extremely for-profit niche (and it has like 4 serious competitors that are all actively in use)
It's a question of timescales and degrees and magnitudes, not of binary "did or didn't destroy". If we hadn't stopped redwood logging in the 20th century, yeah, the ecosystem would be replaced... But probably by something smaller and faster growing. Victory! Redwoods got replaced by smaller trees, mission success.

Monocultures are a scary thing (I'm sure you've heard about how we had to completely switch banana varietals), and having resilient ecosystems is important. I think ATM the consensus is having an apex predator does actually help the stability of these sorts of ecosystems and leads to outcomes most would consider favorable (greater diversity, better density, closer to an equilibrium). Now, we could surely fix this problem by doing it ourselves (eg by subsidizing deer and rabbit hunting and venison), but wolves are probably cheaper.

Re:I was wrong about robots.txt on Thursday July 17, 2025 @12:00AM (#44589578)
In fairness this appears to be the direction we are headed anyway
Re: on Sunday July 06, 2025 @04:17PM (#44483690)
What are you talking about lol, the prose, characters, and themes are all extremely flat. I would say the sci-fi things are what make it good.
Re: on Sunday July 06, 2025 @04:08PM (#44483618)
If you define quality as "layered and meaty" there are many much better books.

Roadside picnic (and its less Russian counterpart, Annihilation), left hand of darkness, Solaris are all excellent.

If you want culturally influential, surely Starship Troopers, Stranger in a Strange land, anything by HG Wells, 1984/Brave New World, Frankenstein (duh)

The characterization in Hail Mary is just so damn weak, even space opera stuff like Bujold