HN user

haberman

20,561 karma
Posts19
Comments3,595
View on HN
blog.reverberate.org 5y ago

Parsing Protobuf at 2+GB/S: How I Learned to Love Tail Calls in C

haberman
6pts0
blog.reverberate.org 6y ago

Hoare’s Rebuttal and Bubble Sort’s Comeback

haberman
147pts48
blog.reverberate.org 6y ago

Optimizing UTC → Unix Time Conversion for Size and Speed

haberman
2pts0
blog.reverberate.org 7y ago

Bloaty McBloatface 1.0

haberman
3pts0
blog.reverberate.org 9y ago

Bloaty McBloatface: a size profiler for binaries

haberman
202pts43
blog.reverberate.org 9y ago

Bloaty McBloatface: a size profiler for binaries

haberman
15pts0
blog.reverberate.org 10y ago

How Do Native Extensions Manage Memory? Part 1: Ruby (MRI)

haberman
1pts0
www.primaryobjects.com 10y ago

Using Artificial Intelligence to Write Self-Modifying/Improving Programs (2013)

haberman
2pts0
research.google.com 10y ago

GPUCC – An Open-Source GPGPU Compiler

haberman
195pts53
www.forbes.com 10y ago

New Evidence for 4.5B Year Old Impact Formed Our Moon

haberman
2pts0
blog.reverberate.org 10y ago

Monads Demystified

haberman
3pts0
blog.reverberate.org 11y ago

Status Update on Upb and Ruby Protocol Buffers

haberman
3pts0
blog.reverberate.org 11y ago

What every computer programmer should know about floating point, part 1

haberman
323pts72
blog.shinetech.com 11y ago

Put on Your Streaming Shoes: Streaming 2M Records/hour into BigQuery

haberman
5pts0
googlecloudplatform.blogspot.com 12y ago

Sneak peek: Google Cloud Dataflow, a Cloud-native data processing service

haberman
6pts0
prog21.dadgum.com 13y ago

The Highest-Level Feature of C

haberman
2pts0
blog.reverberate.org 13y ago

Dumpfp: A Tool to Inspect Floating-Point Numbers

haberman
51pts9
blog.reverberate.org 14y ago

It’s not a bug, it’s a subtle unsupported corner case

haberman
7pts2
blog.reverberate.org 15y ago

EINTR and PC loser-ing: the “Worse Is Better” case study (2011)

haberman
7pts0

I see two solid points here:

1. It's not reasonable to expect the application layer to carefully partition its work into "I/O heavy" and "CPU heavy" parts.

2. It's not reasonable to queue up an arbitrary amount of work without back-pressure.

I haven't used Tokio much, but if it falls prey to these pitfalls, it would make me pause before adopting it.

I think there are probably ways of using Rust async that don't fall prey to these. Maybe not so much with network servers (I haven't written that many of those), but models where you are evaluating a graph and have more control over how new work is added to the system.

There's a dichotomy being presented here where you have to either choose a "style guide" or a programming language feature in order to avoid bugs. The sleight of hand misdirects the reader away from the main way bugs are eliminated: by dedicating engineering resources to it. You're not giving TigerBeetle nearly enough credit. Quite simply they put in the time to find and eliminate the bugs, they make an effort to maintain a healthy relationship with ZSF, and Bun did not do that.

This is not a compelling sales pitch. The point of using a memory-safe language is not needing to put in extra work to avoid use-after-free or out-of-bounds memory access.

It would have been more reassuring to hear that Zig has its own memory safety story that should also be able to prevent most of the same bugs. But instead the answer is "work harder for the same result."

When Zig was first created, Rust looked genuinely harder to use because the borrow checker is so demanding and its errors sometimes so hard to reason about and fix. It made Zig look much simpler and easier by comparison. But now, LLMs are very good at writing Rust. I've been writing Rust using LLMs for weeks and haven't thought about the borrow checker once.

AI made Rust tractable without heroic effort, and in doing so eroded one of Zig's major advantages.

The point about compile times is taken though. Rust is definitely slow to compile, easier to believe it's slower than Zig.

The French, who have "égalité" in their national motto, prohibit the kind of demographic tracking and reporting that US Progressives consider core to their project. Do you think the French don't care about egalitarianism? No, they just have a different concept of what that means. Just like many Americans.

Academics could broaden their horizons and consider the possibility that there are multiple perspectives on egalitarianism, and that the public that funds them is quite split on the issue. If Science is really the priority, it should be easy to stay neutral on unrelated contentious social issues. But I guess it's more fun to preach and condescend to people who disagree, and then complain when those people don't want to fund your enterprise anymore.

It happened directly at least once: https://www.science.org/content/article/u-s-college-first-de...

It happens indirectly all the time. As of 2025, despite all the funding cuts, the AAAS is still publishing its yearly DEI report, now rebranded as an "Inclusivity for Excellence Report", but containing all of the same stuff: an effort to collect and publish as much demographic data as possible, and a stated goal of getting all the numbers to go in the "right" direction. These practices are too ingrained and sacrosanct at this point to let a mere funding crisis throw them off course.

I think you can easily turn this around: scientists who are only willing to do science if it involves preferential treatment, DEI statements, and other practices that half of the country despises are saying that it's better to do no science at all than to set those divisive practices aside and just do science.

Proponents of these policies want to have it both ways; they're at one moment just this small thing that nobody should be bothered by, but in the next moment a nonnegotiable bedrock principle that they are unwilling to stop doing, even under threat of losing funding.

I am not convinced that separating students by ability harms anybody's academic performance. I think it's a false premise that a parent who wants their kid in advanced classes (or advanced schools) is behaving "antisocially."

When there is too great a difference in ability in a single classroom, teachers struggle to serve everyone's needs. I don't believe anyone is well-served by this.

The Prompt API 3 months ago

I'm inclined to think that this will actually decrease the power of echo chambers. Echo chambers become that way by policing dissent, either through moderation or through aggressive attacks on dissenters. A de-snarkifier would de-fang the latter.

I agree that what is toxic to one person is not toxic to another, but think that this is largely because many people enjoy seeing their perceived enemies attacked. In other words, it comes down to a viewpoint bias: attacking my group/viewpoint is toxic, while attacking other groups/viewpoints is good and noble.

My ideal is that a de-snarkifier would be strongly instructed to be viewpoint neutral; to filter based on whether the comment is being respectful, without regard to the views being expressed.

My idea would backfire if other people program their filter to reinforce their own biases by favoring content that they agree with and creating or amplifying personal attacks on their perceived enemies. That would be unfortunate, but ultimately we can only control what we do; each person gets to make their own decision.

The Prompt API 3 months ago

I 100% agree with this. I am certain that I cannot foresee how this would play out in reality.

The Prompt API 3 months ago

That is unironically exactly what I want from social media.

I want the option to engage with the substance of new developments in the world, technology, etc. without the drama. I don't want to be drawn into the drama of strangers (who could, for all I know, just be bots or ragebaiting AIs).

If I want drama, there's plenty of it on TV, or I could talk to my friends about what is going on with people I actually know.

The anti-pattern, in my mind, is logging on to engage with substantive content and to be inadvertently drawn into flamewars with strangers.

The Prompt API 3 months ago

This API seems perfect for an idea I've had for a while: a de-snarkifier for social media.

Social media can be intellectually stimulating and educational, but it's also easy to get sucked into ideological sniping and flamewars, even if you didn't go looking for it. The emotional and intellectual energy spent flaming strangers on the Internet is a complete waste of human capital.

With an API like this, I assume you could have a browser extension that could de-snarkify content before showing it to you. You could ask the LLM to preserve all factual content from the post, but to de-claw any aggressive or snarky language. If you really wanted to have fun, you could ask it to turn anything written in an aggressive tone into something that sounds absurd or incompetent, so that the more aggressive the post, the more it would make the author look silly.

This could have a double benefit. For the reader, it insulates them from the personal attacks of random strangers on the Internet. Don't get me wrong, there is a time and a place for real, charged arguments about important issues that affect us all. But there is little to be gained from having those fights with strangers; on the contrary, I think it poisons the body politic when strangers are screaming at each other.

For the writer, it takes away any incentive to be snarky or rude. If other people filter their content this way, there's no point in trying to be mean to them, and no "race to the bottom" for who can be more nasty.

The artists were certainly making more money from the studios and record labels than they got from the authors of DeCSS, Napster, BitTorrent, The Pirate Bay, etc.

When Gillian Welch wrote "Everything is Free" in 2001, she wasn't complaining about the record companies, she was complaining about Napster.

Q: Do you remember where you were when you wrote “Everything is Free”?

A: I do. I remember exactly where I was and what was going on. It was when Napster was starting to decimate the traditional recording industry dynamic, the viability of making your livelihood [from] your art.

--Gillian Welch, 2018 (https://www.rollingstone.com/music/music-features/gillian-we...)

You can certainly argue second-order effects (ie. we have to restrict information to save information), but the movie studios were making that same argument at the time:

If copyright can no longer protect the distribution of the work they produce, who will invest immense sums to create films or any other creative material of the kind we now take for granted? Do the thieves really expect new music and movies to continue pouring forth if the artists and companies behind them are not paid for their work?

--Jack Valenti, Motion Picture Association of America, 2000 (https://archive.is/PBy7C)

It sounds remarkably similar to what people concerned about AI say today. How do we make sure that artists get paid?

I don't think many hackers found the argument compelling at the time.

I'm old enough to remember a time when the primary hacker cause was DRM, the DMCA, patent trolls, export controls for PGP, etc. All things that made it difficult to use information when you want to. "Information wants to be free."

It's wild to see the about face. Now it's:

If [companies] can’t source training data ethically, then I see absolutely no reason why any website operator should make it easy for them to steal it.

It would have been very difficult to predict this shift 25 years ago.

Wait, didn't Clinton actually balance the budget? That gets props from me; no government since then has actually given Americans an honest picture of what it actually takes to run a balanced budget, which will require some combination of higher taxes and/or decreased spending.

I would be open to paying higher taxes if I believed it would help address the deficit and debt (instead of just enabling more spending) and if I believed that the money was being well spent.

Earlier in my adulthood, I would happily vote for almost any tax or levy, because I had faith that that money was turning directly into societal good.

I have lost that faith. In the worst case, money seems to be grossly mismanaged (here is a local example from just last month: https://www.seattletimes.com/seattle-news/politics/fallout-f...).

In other cases, it is going to real nonprofits that are tasked with solving problems that never seem to get better, no matter how much money is spent.

In yet other cases, the money goes to building transit (something else I was previously very bullish on), but that, once built, seems to be governed by principles of limitless permissiveness (an example from a few days ago: https://komonews.com/news/local/only-8-metro-fare-enforcemen...)

It's hard to feel invested in the programs that my taxes pay for when it doesn't feel like they reflect my values.

Obama's FAA disincentivised its traditional "feeder" colleges that do ATC courses to "promote diversity", net outcome was fewer applicants

It was much worse than that. Students who had already spent years studying to be air traffic controllers through the CTI program were subject to a sudden policy change that disqualified them from entering the profession unless they passed a “biographical questionnaire.”

85% of candidates failed this questionnaire, but the National Black Coalition of Federal Aviation Employees (the organization that pushed for this change to begin with) was feeding the “right” answers to its own members.

“Right” answers included things like having gotten bad grades in high school science class. You can take the test for yourself here and see how you score: https://kaisoapbox.com/projects/faa_biographical_assessment/

I can’t blame anyone for thinking this sounds too outrageous to be real, but all of it is public record at this point and the subject of an ongoing lawsuit: https://www.tracingwoodgrains.com/p/the-full-story-of-the-fa...

Thankfully, there is the esm-integration proposal, which is already implemented in bundlers today and which we are actively implementing in Firefox.

From the code sample, it looks like this proposal also lets you load WASM code synchronously. If so, that would address one issue I've run into when trying to replace JS code with WASM: the ability to load and run code synchronously, during page load. Currently WASM code can only be loaded async.

Not everyone in history thought that 12-TET was an acceptable compromise. Johann Sebastian Bach thought we should use other tuning systems

This is presented as fact, but as I understand it there is no conclusive evidence for what Bach intended wrt temperament. There is a theory that the title page of the Well-Tempered Clavier encodes Bach’s preference in the calligraphic squiggles, but this is a recent theory and speculative. I don’t believe there are any direct statements by Bach as to his intention.

So many of our foundational institutions – hiring, journalism, law, public discourse – are built on the assumption that reputation is hard to build and hard to destroy. That every action can be traced to an individual, and that bad behavior can be held accountable. That the internet, which we all rely on to communicate and learn about the world and about each other, can be relied on as a source of collective social truth. [...] The rise of untraceable, autonomous, and now malicious AI agents on the internet threatens this entire system.

I disagree. While AI certainly acts as a force multiplier, all of these dynamics were already in play.

It was already possible to make an anonymous (or not-so-anonymous) account that circulated personal attacks and innuendo, to make hyperbolic accusations and inflated claims of harm.

It's especially ironic that the paragraph above talks about how it's good when "bad behavior can be held accountable." The AI could argue that this is exactly what it's doing, holding Shambaugh's "bad behavior" accountable. It is precisely this impulse -- the desire to punish bad behavior by means of public accusation -- that the AI was indulging or emulating when it wrote its blog post.

What if the blog post had been written by a human rather than an AI? Would that make it justified? I think the answer is no. The problem here is not the AI authorship, but the actual conduct, which is an attempt to drag a person's reputation through mudslinging, mind-reading, impugning someone's motive and character, etc. in a manner that was dramatically disproportionate to the perceived offense.

he eventually needed to write bluntly

Is there a history of that here? Were there earlier clear statements of expectations (like CONTRIBUTING.md) that expressed the same expectations, but in a straightforward way, that people just willfully disregarded?

I don't mean to "ding" anybody, I mostly just felt bad that things had gotten to the point where the author was so frustrated. I completely agree that project owners have the right to set whatever terms they want, and should not suffer grief for standing by those terms.

I don't see anything wrong with the way he expressed himself, and I think his point is totally legitimate. I mostly just felt bad that he experienced so much grief about it, on account of a gift he was offering to the world.

Lately I'm seeing more and more value in writing down expectations explicitly, especially when people's implicit assumptions about those expectations diverge.

The linked gist seems to mostly be describing a misalignment between the expectations of the project owners and its users. I don't know the context, but it seems to have been written in frustration. It does articulate a set of expectations, but it is written in a defensive and exasperated tone.

If I found myself in a situation like that today, I would write a CONTRIBUTING.md file in the project root that describes my expectations (eg. PRs are / are not welcome, decisions about the project are made in X fashion, etc.) in a dispassionate way. If users expressed expectations that were misaligned with my intentions, I would simply point them to CONTRIBUTING.md and close off the discussion. I would try to take this step long before I had the level of frustration that is expressed in the gist.

I don't say this to criticize the linked post; I've only recently come to this understanding. But it seems like a healthier approach than to let frustration and resentment grow over time.

More concretely, I think the magic lies in these two properties:

1. Conservation of mass: the amount of C code you put in will be pretty close to the amount of machine code you get out. Aside from the preprocessor, which is very obviously expanding macros, there are almost no features of C that will take a small amount of code and expand it to a large amount of output. This makes some things annoyingly verbose to code in C (eg. string manipulation), but that annoyance is reflecting a true fact of machine code, which is that it cannot handle strings very easily.

2. Conservation of energy: the only work that will be performed is the code that you put into your program. There is no "supervisor" performing work on the side (garbage collection, stack checking, context switching), on your behalf. From a practical perspective, this means that the machine code produced by a C compiler is standalone, and can be called from any runtime without needing a special environment to be set up. This is what makes C such a good language for implementing garbage collection, stack checking, context switching, etc.

There are some exceptions to both of these principles. Auto-vectorizing compilers can produce large amounts of output from small amounts of input. Some C compilers do support stack checking (eg. `-fstack-check`). Some implementations of C will perform garbage collection (eg. Boehm, Fil-C). For dynamically linked executables, the PLT stubs will perform hash table lookups the first time you call a function. The point is that C makes it very possible to avoid all of these things, which has made it a great technology for programming close to the machine.

Some languages excel at one but not the other. Byte-code oriented languages generally do well at (1): for example, Java .class files are usually pretty lean, as the byte-code semantics are pretty close to the Java langauge. Go is also pretty good at (1). Languages like C++ or Rust are generally good at (2), but have much larger binaries on average than C thanks to generics, exceptions/panics, and other features. C is one of the few languages I've seen that does both (1) and (2) well.

The rate of college attendance has increased dramatically in the last 250 years, and especially in the last 75.

In 1789 there were 1,000 enrolled college students total, in a country of 2.8M. In 2025, it is 19M students in a country of 340M. https://educationalpolicy.org/wp-content/uploads/2025/11/251...

In 1950, 5.5% of adults ages 25-34 had completed a 4 year college degree. In 2018, it was 39%. https://www.highereddatastories.com/2019/08/changes-in-educa...

With attendance increasing at this rate (not to mention the exploding costs of tuition), it seems possible that the methods need to change as well.

I’ll repeat what I said at that time: one of the benefits of the new design is that it’s less vulnerable to the whims of the optimizer: https://news.ycombinator.com/item?id=43322451

If getting the optimal code is relying on getting a pile of heuristics to go in your favor, you’re more vulnerable to the possibility that someday the heuristics will go the other way. Tail duplication is what we want in case, but it’s possible that a future version of the compiler could decide that it’s not desired because of the increased code size.

With the new design, the Python interpreter can express the desired shape of the machine code more directly, leaving it less vulnerable to the whims of the optimizer.