Overview
tofu is a protocol and an asynchronous Zig messaging library used to:
- Build custom communication flows.
- Create non-blocking systems.
- Enable peer-to-peer messaging between applications.
tofu is a completely new project. It is not a port of old code, and it does not use any C libraries. It is built 100% in native Zig. The core functionality uses only the standard library.
Why tofu?
As a food, tofu is simple and doesn’t have much flavor on its own.
With tofu cubes, you can:
- Eat them plain as an easy snack.
- Add some spice to make them better.
- Cook up something really tasty.
As a protocol, tofu uses messages like cubes. By "cooking" these messages together, you can grow your project:
- Start with minimal setups.
- Build complex flows.
- Create full distributed applications.
Remember
tofu is as good as you are a cook.
A Bit of History
tofu did not come from nowhere.
The journey began in 2008 when I first built a similar system. I maintained and ran that system for many years in high-stakes environments. It powered everything from basic IPC to complex data transfers in a custom distributed file system.
I left that project a few years ago, but I haven't heard any complaints yet — the systems are still running strong.
Corporate lawyers can stay calm: I didn't take any code. I only took the "smell." (See the precedent case about paying for a smell).
By "smell," I mean the core philosophy:
- The Message is the API: The data itself defines the connection.
- Gradual Evolution: Start with something simple and grow it into a powerful system over time.
- The Mantra: "Connect your developers. Then connect your applications."
Credits
- Karl Seguin — for introducing me to Zig networking
- Franck Blettner — for creating the template repository for documentation sites, which this documentation is based on
- Zig Community Forums (in order of my registration) - for your help and patience with my posts
Last but not least
⭐️ Like, share, and don’t forget to subscribe to the channel !