System optimizer concurrency geek.

Joined August 2019
97 Photos and videos
Protty retweeted
Whatever your transactional database is, help me understand your use of it. This survey is run by @theconsensusdev, independent of any database or vendor. RT or pass along to industry peers for broader representation forms.gle/fqjQsezWsztxvYD66
1
11
15
4,949
If you're not doing deliberate low-level code, can't seem to stop getting memory errors, or work on systems projects with a team of varying skill levels, Rust (or any lang with Refinement types an optimizing compiler) is probably the better tool, I'd assume.
Unfortunately, I don't use Zig now. Every 1.5-5x human DX productivity boost from Zig features is eclipsed by the 100x boost from coding agents writing Rust: Allocator interface: This is my favorite Zig feature, you feel so galaxy brain using a specialized allocator to optimize a code path (e.g. arena, stack fallback etc). The problem in Rust used to be that there was no Allocator interface equivalent and if you wanted a Vec<T> that used a custom allocator you literally had to copy paste the std version and modify it to use it (this is what Bumpalo did, look at the source). For a long while now there has been an Allocator trait in nightly, and it seems to be good now. Because it is a trait it is static dispatch, vs Zig's which is based on a vtable. Unlike Zig there isn't a community-wide convention of designing data structures to be parametric based on the allocator, but AI changes the game and makes it trivially to copy paste code and change that. I find it works well enough for my use-case. Arbitrary bit width integers packed structs: Another beloved Zig feature of mine. It makes it so easy to do DOD-style CPU cache optimizations and stuff like tagged pointers, NaN boxing, etc. and even made bitflags really easy to make. You could always do this in Rust or any systems programming language but it was really ugly/unergonomic. The least worst option was using some crate like bitfield/bitflags which both rely on proc macro magic to work. Now, with coding agents I literally do not care how annoying it is to write the code by hand. Comptime: This is Zig's flashiest feature, no other programming language except maybe for obscure dependent-types langs have compile time evaluation as nice as Zig's. I thought I would miss it a lot, but I actually don't. For me, 95% of comptime usage is to create Zig's version of generic data structures with parametric types. Rust has a better designed type system IMO (see next section). In the remaining 5% of cases, not having comptime sucks. The only reliable way to reach an equivalent is through codegen. I'm making a game right now, and I have hardcoded hitbox geometry data generated from a tool that I want to bake into a data structure. Without comptime, I have to get Claude to write a script that generates the Rust file. However, I don't find myself needing compile time evaluation that much anyway. Rust's type system: I think I'd rather trade having comptime for Rust's better-designed type system, especially for bounded polymorphism (traits/typeclasses). Trying to do the equivalent in Zig is a nightmare. Also, I think that Rust's type system allows you to enforce more variants and prevent coding agents from making common mistakes. In my game I use the euclid crate which essentially allows you to not mix up coordinate spaces (very common problem in graphics programming) by creating specialized types for each coordinate space (e.g. Point<Screen> or Point<World>) Not having to deal with memory issues: With coding agents allowing 100x more code to be written, this also means you need to scrutinize 100x more Zig code for memory issues. Without formal verification, the surface area of the search space to enumerate to find bugs is just so much larger now. With the magnitude of code being generated now, Rust is even more attractive. Rust's tradeoff was always that it hinders developer productivity especially if you are unfamiliar with borrow checker, but this simply does not matter with coding agents anymore. And if you do use unsafe in Rust there's tools like miri which you can have the coding agent run the code against to make sure it doesn't cause UB or isn't violating Rust's aliasing rules when it comes to unsafe. I still miss writing Zig and find it to be a great language but I like Rust more and coding agents work with better with it.
9
4
116
15,145
For 2. Zig can help with spatial safety, (mis/un)used typed memory operations, and often memory leaks. But it doesn't help with logical/lifetime use-after-frees or data races. Some seem to hit those frequently still, so a static checker can save them after some (minor?) cost.
1
13
1,046
For 3. I've observed that teams with devs who struggle with the above can result in "cleanup crew" situations to keep up the speed. A static soundness checker lowers the cost & chance of other team members having to do said cleanup: x.com/_Felipe/status/2053101…

Replying to @_Felipe
Competent engineers can write safe C/C and Zig but building a team that’s competent as a collective is really hard. Specially if it’s under market pressure to ship quickly. Now that everyone has a very productive intern working with them at all times, this became obvious.
10
1,035
Finally hit a problem where DRAM latency was the bottleneck. Optimized it accordingly with ILP for some 3x perf gains
1
23
1,587
🐍
2
439
Protty retweeted
gist.github.com/kprotty/d963… Atomic ops are atomic irrespective of their orderings. The ordering instead dictates how other memory ops around the atomic op are made visible to other threads. Can then encode this as atomic-op dependencies instead of opaque Acquire/Release tags.
2
6
1,082
🙏
12
827
Protty retweeted
2025 was the Year of the @TigerBeetleDB, with 50 project folders and 100 artworks!!🤯🥳 I missed spending time on personal projects, but I had some great moments that are directly and indirectly connected to these beetles, and I’m more than ready for 2026! BTHF! #artvsartist
3
15
1,695
31 Dec 2025
4 more
1
646
Protty retweeted
Excited to share that TigerBeetle and @synadia have pledged $512,000 to the @ziglang Software Foundation. Zig changed my life, making TigerBeetle possible. It's been an adventure these past 5 years, and thrilled to pay it forward, together with my friend @derekcollison.
Excited to announce that TigerBeetle and @synadia have pledged $512,000 to the Zig Software Foundation. tigerbeetle.com/blog/2025-10…
10
20
274
28,163
Protty retweeted
17 Aug 2025
Replying to @DominikTornow
9 Jul 2025
Mutexes, Condvars, and Rwlocks are a scam. They introduce latency bottlenecks/dependencies from the OS scheduler. Instead, design data flow first, then optimize its channels second:
1
1
25
8,387
5 Aug 2025
Writing fast code under optimizing compilers feels similar to *prompting: 1) Developing an intuitive understanding of how the model combines your patterns to outputs 2) Knowing what a "good" output is, in regards to correction. * any deterministic ML inference with text input
5
36
3,197
31 Jul 2025
Blog: You can build any blocking sync primitive using any other one. And it's not just a neat realization. It actually works kprotty.me/2025/07/31/sync-p…
3
22
154
10,852
9 Jul 2025
Mutexes, Condvars, and Rwlocks are a scam. They introduce latency bottlenecks/dependencies from the OS scheduler. Instead, design data flow first, then optimize its channels second:
5
6
127
12,321
9 Jul 2025
Re: channels, don't send to an actor task/thread. Instead, have the first sender on empty BECOME the receiver. On fan out, prefer workstealing or duplication at worst. On fan in, bump a counter & wake on last instead of multiple back/forth joins/acks. Avoid communication latency
1
1
14
1,964
9 Jul 2025
This applies both across cpu cores and across the network. It's just exacerbated and more obvious in the later, and sometimes applied without optimization in the former.
13
1,729