Here’s an excerpt from the GNU manual for M4, a general-purpose macro processor, like the C preprocessor but for all kinds of text:
Some people find m4 to be fairly addictive. They first use m4 for simple problems, then take bigger and bigger challenges, learning how to write complex sets of m4 macros along the way. Once really addicted, users pursue writing of sophisticated m4 applications even to solve simple problems, devoting more time debugging their m4 scripts than doing real work. Beware that m4 may be dangerous for the health of compulsive programmers.
When I first read that, I thought it was some kind of GNU humor. I can now say that it wasn’t humor. I am now fully addicted to M4, going so far that this website now completely uses M4 for templating.
The codebase is a weird mess of HTML, M4, Python, Bash scripts and awk.
If you never used M4 before, it allows you to do macros. Pretty
simple, right? Wrong! M4 is a lot stronger than other macro processors
like the C preprocessor. For example, I can use the esyscmd
macro to run commands. A good example is getting the build time using
the date command: Sat May 16 17:10:19 UTC 2026 . Or the
python version, 3.12.3 . M4 can also do very complex stuff
like conditionals or recursion, but I am lucky that this website doesn’t
need that. Yet.
As a person that comes from TypeScript and JS frameworks like Tanstack Start, this weird stack of M4, Bash and Python does feel really refreshing. Could this entire site be one JS script? Yeah, likely. But this approach makes me feel a lot more accomplished, actually.
I just hope I don’t go too far into the “Modern Web Dev Sucks!!!!!” ecosystem and start using htmx. That would be really bad.
I want to go a bit further about what everything that isn’t M4 in this codebase does.
My Python usage in this project was kept quite small, that’s like because I am a former self-proclaimed python hater. I just use it for sorting Articles and generating the Atom feed.
Who needs Makefiles when you have good ol’ Bash scripts. I used it here for running all the commands for building the file into final static HTML.
I just used awk for generating the list of Articles on /articles. I think me using M4 for this project wasn’t that insane. This is.
This is generally a really weird tech stack, which I am pretty sure nobody else in this world uses. But hey, feel free to contact me if you also started using the Awk+M4+Pandoc+Python+Bash tech stack. And like every good tech stack, it of course needs an acronym. What about AMP2B? I would say it sounds quite good, for my standards at least.
Well, anyways I hope you enjoyed this first blog article, even though it is quite short. I will probably make some blog posts about other stupid stuff in the future, so put my atom feed into your feed reader to get it directly when it comes out.