Years ago while working on a service that would be deployed in Kubernetes, we decided to use the simplest possible TCP based healthcheck. Not because TCP was the right choice, but because implementing a simple HTTP endpoint was more code than it was worth. For our Go services the equivalent HTTP endpoint was only a couple of lines. In fact, we eventually ended up replacing our TCP endpoint with a small Go wrapper around our C++ service.
The Go standard library has done a great job at designing a very ergonomic HTTP library. C++ now has all the right building blocks to express the same design concepts: coroutines, concepts, std::expected, std::jthread. The question is, do these patterns transfer from Go to C++? How do we evaluate the effectiveness of the resulting design?
In this talk I will present a small HTTP library inspired by Go's net/http, built with the tools available in C++23. To evaluate the resulting design I will draw on ideas from Felienne Hermans' The Programmer's Brain and the principle, from Structure and Interpretation of Computer Programs, that API design is language design.
Along the way we'll see which patterns transfer cleanly, which need translation, and why telling the difference is a skill worth developing even if you only work with C++.