Way back in 2020, in my post titled Blog Generator Rewrite I wrote about how I had rewritten my blog generator in C++. Over the last few years I've been writing nearly all of my personal code projects using C++, with Bazel as my build system. Unfortunately, during the last three years or so my blog software bit rotted. Today I'm happy to announce that my blog is back. It's taken a while, for a few reasons.
The first reason (the technical one) is that I had written all of the HTML
templates for my blog using
Jinja syntax. Jinja itself is
written in Python, so I was actually using
Jinja2Cpp to render the templates from
C++. For quite a long time Jinja2Cpp was basically unmaintained, and didn't work
with new versions of the C++ language standard. Fortunately it looks like the
Jinja2Cpp project has been since revived (according to their releases page they
now support up to C++20). In any case, I had already decided to rewrite
everything in inja, which is another C++
template library "inspired" by Jinja syntax. Compared to Jinja2Cpp, inja is a
lot simpler but also supports a more limited subset of Jinja features. The other
nice thing about inja is it has a single-header mode which makes it trivial to
write a Bazel build rule for it (in fact, I just copy the amalgamated inja.hpp
file directly into my Bazel repo). I'm still using
md4c to actually render the Markdown.
The other reason I stopped blogging is that due to a combination of personal and work reasons, I had just lost a lot of interest in blogging. In my personal life all I will say is that a lot has changed in the last few years, and I don't have as much desire as I once had to spend many hours blogging.
In my work life, I find my current work (I've been at Waymo for over four years now) extremely engrossing. For better or worse, a lot of my coding energy is currently focused on work, rather than personal projects, open source projects, etc. In the past, when I was blogging frequently, part of my motivation for spending so much time on this blog was due to general unhappiness at work. I found my work generally uninteresting. At times I felt like my work contributions weren't being properly recognized, and more broadly I at times I felt like a cog in a big machine where it was difficult to make a big impact even in the things that I genuinely was interested in and wanted to contribute to in a meaningful way. I think these are natural feelings that nearly everyone has at times. Of course, there are times today where I feel some of these same feelings. But generally I am much happier at work now than I once was, there is nothing about my job I find boring or uninteresting, and this has been a major factor contributing to my recent lack of blogging.
The good news is that my blog works again. I am sure there are rendering issues in older posts due to the fact that I had a lot of weird ad hoc features for specific posts, and I've rewritten all of the rendering logic using an entirely new HTML template library that isn't 100% compatible with the old library I was using.
I have also learned about a lot of interesting things since I last blogged regularly. I have a lot to write about once I can compose my thoughts. Some of the things that are top of mind for future blog posts (in no particular order):
- Many C++ language things, and some as they pertain to compilation and linking.
- Covering some of the darker corners about how memory management works in the Linux kernel, especially in low memory situations or under memory pressure and on NUMA hosts.
- A lot of things I've learned about the kernel perf events API.
- How to use AutoFDO (a.k.a. "AFDO") effectively.
- Some interesting things I've learned about
ITIMER_PROF
, and generally how signal delivery actually works in multi-threaded programs on Linux. - Other profiling things, like how to schedule profile captures effectively.
- Linux RT scheduling (i.e.
SCHED_FIFO
), especially as it relates to the Linux cgroups v1 and v2 cpu controller implementations.
Some of these are very complex topics that will take a lot of time and energy for me to write about properly. The most complex topics (which, unfortunately, are probably also the most interesting) are the ones that will probably take me longer to allocate time to write about.
It's also worth nothing that while I can talk about all of these things in general terms, I also need to be careful not to talk about any of these things in a way that is too specific to my current work. This is a principle I've always applied to my blog, but given my current job it's especially important that I be mindful of this.