I tend to work on lots of “projects” at once - they’re basically interesting ideas I’m taking some time to explore. They’re usually out to make things more simple and/or efficient, without trade-offs wherever possible. I’m introducing them here so that I’ve at least put them out there, even if I don’t talk about them in depth anytime soon.
This is my blog – a series of irregular updates about my work. There’s an RSS feed available if you want to keep up.
Macros are a very useful feature of the C preprocessor for reducing boilerplate. It is well-known that they have limited processing power; most importantly, they cannot recurse, and cannot iterate over lists. Libraries for meta-programming (e.g. Boost.Preprocessor and metalang99) work around this, but are only capable of executing a limited number of iterations, and have complex implementations. However, an obscure GCC feature can be abused to allow for “true” recursion in macros in a relatively elegant manner, allowing more complex and useful macros to be implemented.