Recent submissions

Comment · 1 day ago
Maybe smoking trends come in waves.
Comment · 1 day ago
Then really shouldn't it be "everything is about money"? After all, it's clear that the actual lie is convincing a big group of people that they don't share a common cause. Racism has many causes, but using it as a divide and conquer tactic has to be one of the most disgusting ones.
Comment · 1 day ago
Rare in the northeast US. In fact, I saw two students smoking on a college campus just last week and did a double take. I had not seen a single student smoking in at least a decade. Then I laughed remembering how when I was in college in the 90s, almost everybody smoked at least a little (often at parties), and seeing students smoking at the entrance to the dorm was pretty normal. I am an asthmatic so I've never smoked, and I remember my friends being stunned by this one night when we were out at a bar. Things have changed a lot around here.
Comment · 4 days ago
Sure, but what do you propose governments do to stop it?
Comment · 6 days ago
Comment · 7 days ago
You should do it. But I recommend a book or two on compiler design. There are useful techniques (like SSA) that simplify program analysis if you decide you want to dip your toes into adding optimizer passes. Building stuff yourself, the hard way, is definitely the best way to learn. I wish I had unbounded time to do it…

Edit: I like the Appel compiler book. One of my students enjoyed “Writing a C compiler” by Nora Sandler. There are also a number of classic compiler books that feel more relevant once you are deep in the weeds.

Comment · 8 days ago
Modern computers are exquisitely sensitive to spatial and temporal locality because many of the hardware features that speed your code up (for free!) take advantage of data or instructions that are “next to each other.” This can be a challenge in a functional program, because not only do you often have little control about where things go, the abstractions that make cool things possible (eg, closures, or lazy evaluation) naturally introduce indirection that hurts locality.
Comment · 10 days ago
Whether code review is inportant or not probably depends on whether the problem someone is solving is important or not. But when it is important, I think we should be putting the onus on the person who filed the PR instead of burning our own neurons trying to understand volumes of stuff. Tell me what you asked the AI to do. Why is that a good idea? Once I hear that answer (because many junior programmer ideas don’t even get past that point), let’s look at the code together. Tell me why you think the code you submitted does what you say. Did you look at the code? Did you write tests? Did you check for test coverage? Maybe you’re a little smarter than that. Did you think through pre- and post-conditions? Corner cases? Are certain undesirable behaviors impossible? How do you enforce that? Types? State machines?

Even before slop coding good code review was hard, because verification is a hard problem. But we have many tools at our disposal to increase confidence without having to go full-on mathematical proof. Human understanding has always been the bottleneck, and as long as the thing you are doing is for humans, humans will have good reasons to want to understand it, so they will remain the bottleneck. This is ok. It’s ok for humans to be the rate-limiter. But don’t go it alone and fry your own brain.

Comment · 10 days ago
Codex is interactive. This appears to be batch.
Comment · 12 days ago
Comment · 12 days ago
Comment · 13 days ago
This literally makes no sense.
Comment · 14 days ago
You don’t need 2 and 3. You can express them just with with T. For example, you could use an Either type for “good, here’s your value/bad, here’s your error.” If you want to get more sophisticated, you can add a type with extra error cases. In my own combinator libraries, I also include extra failure information to make diagnosing failed parses easy (and to generate pretty output). This does not change the fact that T is sufficient.
Comment · 14 days ago
> T is not any type, T is a type defined at compile time,

This is a distinction without a difference. In a static, type-safe language, T always has to be instantiated with a type. But that does not change the fact that, from the perspective of the function definition, T is any type. T must be a specific type for the function call.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton