yoctochat: the tiniest chat servers on earth!
In 2020 I wanted to learn more about io_uring, a Linux kernel tech for asynchronous system calls.
As it was not a familiar model to me, I decided to write a series of
tiny multi-user chat servers, each using a different multiplexing
technology (like select()
, poll()
, etc). I called these programs
yoctochat. The idea was to write a
program in a few different ways that I do understand, and then use them
as a guide and point of comparison for the new technique that I don't
understand.
My very first experiences with Unix programming, way back in 1998, was hacking on talkers, which were kind of like a MUD with more emphasis on the chat and social elements and less on the game elements. It was studying these packages and writing my own that really kicked off my career, which has largely focused on building, running and scaling network servers of all kinds.
I very much enjoyed writing these servers. Obviously, they were a nice little reminder of my youth, and I still get a buzz from opening a few network connections, typing into one, and seeing something appear on the others - it will never not feel magical to me! They were also a nice reminder that even at the lower levels of the stack, useful and interesting things can be written without much fanfare or ceremony, and I think as our systems seem to gain complexity over time, that's a useful thing to be reminded of.
As it was, I did write an io_uring version, and it was extremely useful to have the other three versions to compare with. I learned something surprising: its actually an asynchronous syscall facility, not just another event readiness mechanism. I was so surprised by this that I really wanted to tell someone about it, so I wrote about it. This post was quite well received, and generated some good discussion and a few kind words from people that learned something from it (it was also referenced briefly in a CS course, which made me smile).
This whole process is reflective of an crucial aspect of my identity as a technologist. I am curious and I want to understand what things are, why they are that way and how they came to be that way. Then, once I'm done, I want to tell people a great story about what I've learned. In my experience the most effective people in our industry are the ones that actively seek to understand their surroundings, and I really want to reach that level myself and help others get there too.
Further reading: