Skip to content

Blog

Pony’s Arena Allocator

Here’s how it was. We’d been running stress tests on the TCP system in ponyc every day for a really long time. Those tests hadn’t failed in forever. There’s two ways you can look at “no tests are failing.” Either your system is rock solid or your tests aren’t covering enough of the codebase. I’d long felt that the lack of stress test failures was the result of “tests aren’t good enough.”

A few months back, I did something about that. I took the TCP stress tests that did the same thing on every run and added some “swarm testing goodness” — randomizing what they were doing and how they were being run, from run to run. A lot more code was getting exercised, and out popped a bunch of bugs.

This post is about one of those “bugs.”

Last Week in Pony - July 12, 2026

This week’s theme song is Van Morrison’s “Caravan”. It’s a banger. Turn it up. That’s enough. So you know it’s got soul. Does it tie in with anything in this issue of Last Week in Pony? I could probably invent something, but really, I just love to drop something I’ve been enjoying lately in here every week because why not? If I’m going to write all this stuff up every week, I deserve a few indulgences.

Last Week in Pony - July 5, 2026

This week’s theme song is Player’s “Baby Come Back”. People ask me sometimes how many people use Pony, whether it’s used in production. The honest answer to both is that I have no idea. We’ve never had much visibility into who’s out there. Every so often a hint comes through that someone is shipping Pony for real, and then it goes quiet again.

Improving Runtime Test Coverage

Pony’s runtime has a set of stress tests. They run in CI, each one a program that exercises the runtime over and over for an extended period of time: one passes messages between actors without a break, another opens and closes network connections again and again, sending data back and forth. The idea is that the more you push on a part of the runtime you think is bug-prone, and the longer you keep at it, the more likely you are to shake out a bug that only turns up once in a while. For the runtime, bug-prone means “susceptible to concurrency issues”. And we hammer away at those areas as much as we can. Or try to anyway. That was the idea.

Look Ma, I put a compiler in the compiler

Calling C from Pony is usually easy. You write the FFI declarations, you call the function, you’re done. Sometimes it isn’t that easy: you need to call a macro, so there’s no symbol to bind to. Or you have to fill in a struct by hand before you can pass it in. Or the calling convention is one Pony’s FFI can’t express. C has all kinds of little oddities that don’t line up with Pony. When you hit one of those oddities, it is time to reach for a shim: a small piece of C between Pony and the library. Building it and shipping it has always been the hard part. Not anymore.