Weeknotes 2025 W42: Properly sick
Quick bits:
-
Welcome to my fifth year of writing weeknotes.
-
Two weeks ago, I mentioned having a two-hour delay on my trip to Belgium. I did unfortunately not qualify for that 50% refund, as the delay was caused by a Polizeieinsatz1 due to people walking on the train tracks, and that means no refund eligibility. Schade. I did get a €5 refund for my seat reservation, though.
-
I made my first contribution to Zig! Sort of.
-
I’m not really following the drama in the Ruby community. All I can see is that it’s a mess.
I’ve been properly sick for the first time since I got COVID-19, back in 2023. Ugh.
It started with a throat so sore I could barely swallow. At least I’ve got my medication. Paracetamol + Ibuprofen worked remarkably well, and gave me a good night of sleep.
But my head is still completely clogged up, I am low on energy, and I’m sleeping a ton. This sickness — whatever it is, at least not COVID-19 — better wrap up its business and fuck off soon.
Also: I am so happy that food and grocery delivery services exist. The idea of leaving my house2 fills me with dread at the moment.
I’ve had to miss one acting class. This is annoying, because there aren’t that many classes left before the public performance in December. I’ve also had to miss two TTRPG sessions, and it has now been over a month since we last played.
Okay, so I know I wrote “low on energy” but I think I still achieved a lot this week. Not that I needed to — I just did.
First, I released a new Nanoc version Nanoc 4.14, which adds support for TOML frontmatter and TOML configuration. Here’s a snippet from my updated web site:
+++
title = "Weeknotes"
layout = "/prime.*"
+++
<p>Every Sunday, I publish my weeknotes. […]</p>
YAML is a mess, and I dislike it the more I use it. Parsing it is a nightmare, too! My Zig SSG doesn’t support YAML frontmatter (yet) because I couldn’t find a reasonable YAML parser. TOML, on the other hand, proved to be much simpler, both to parse and to read with human eyes.
Did I add TOML support to Nanoc so that I could migrate off it to my new Zig SSG? Ha! Don’t be silly. But erm, maybe? That’s not going to happen for a long time, though.
I added a simple benchmark for Deng, and the results are sweet:
Benchmarking evaluator... done
times (warmup): 10000
times (real): 100000
average duration: 8306ns
8.3µs — and that is for a debug build. A build with --release=fast is more impressive:
Benchmarking evaluator...
Benchmarking evaluator... done
times (warmup): 1000
times (real): 10000
average duration: 551ns
0.6µs to evaluate a template once. That sure is fast!
I haven’t benchmarked the compiler, just the virtual machine. The compiler doesn’t need to be that fast, because there will typically be only few templates, and they’re all only compiled once.3
Deng also has whitespace removal now. Replacing {{ with {{- will remove the whitespace that occurs before that {{- token in the template; the same also works for -}}, {%- and -%}. Here is an example:
<ul>
{%- for page.tags as tag -%}
<li>
{{- author -}}
</li>
{%- endfor -%}
</ul>
The result is nicely compact:
<ul><li>Denis</li><li>Henry</li></ul>
The whitespace removal is done at compilation time, so it does not impact evaluation performance-wise.
Deng is now in a good-enough spot that I picked up work on my Zig static-site generator (SSG) again. The SSG now integrates properly with Deng, and of course the entire reason for creating Deng was to use it in this SSG.
Writing a library (Deng) versus using it (in the SSG) can be a world of a difference. I found many sharp edges in Deng that I’ve been working towards sanding off.
It has occurred to me that a lot of the spare-time/open-source work that I do is related to writing and publishing. I’ve built static-site generators (Nanoc and this unnamed Zig one), a templating language (Deng), markup languages (D★Mark and TomatenMark), and other tools (Deniki).
One of the differences between this new SSG and Nanoc is that the new SSG has filters that can act on metadata, not just content. In Nanoc, a filter has the following signature:4
In this new SSG, the signature instead is this:
This is nice for two reasons:
-
It covers some of the use cases for which a
preprocessblock is needed in Nanoc, such as finding backlinks, constructing a cache-busting hash, or extracting EXIF metadata from images.5 -
It opens up support for markup languages that have their own frontmatter syntax, like MultiMarkdown or AsciiDoc.
In addition, I am toying with the idea of having content not be limited to just text or binary data. Imagine being able to store a parsed AST so that subsequent filters can operate on it, a bit like this (in pseudocode):
match "/**/*.md" {
filter :parse_md
filter :add_header_ids
filter :serialize_md_to_html
}
This would open up the possibility of operating on in-memory binary data, too.
Entertainment:
-
Wolfenstein: The New Order6 is a really difficult game. I keep trying to engage nazis in open conversation (gotta listen to both sides, you know?) but they don’t listen and just shoot at me.
Just kidding. I shoot nazis in the head because that is what you do with nazis. And when I run out of nazis? Head to the next level and kill more!
It’s an entertaining game, but it feels remarkably old. This game is from an era where bloom and depth-of-field effects were fancy and new, and it’s just too much.
-
Wolfenstein II: The New Colossus7 is certainly the better of the two games. Better visuals, but also just much better writing, with great characters (I’m fond of Grace; she absolutely does not deserve the hate she gets). Gameplay-wise, both games are similar enough.
Also: the US being taken over by nazis? Pffh! How unrealistic.
Links:
-
The Ensh*ttification of Everything with Cory Doctorow (Adam Conover): What a great interview.
-
Greta Thunberg: “They kicked me every time the flag touched my face”
-
Some DVD re-releases got cheapened out in a weird way (or may not even be legit!) (Technology connections - secondary channel): Oh no!
-
Star Trek Strange New Worlds Is a Centrist Space Fantasy (Jessie Gender)
-
Introducing the Fastmail desktop app: Nice! I replaced my Safari stand-alone app with the Fastmail desktop app and it’s great.
-
This country is 17% fake (
Map MenKaartmannen) -
Why libs love a Charlie Kirk (Thought Slime)
-
The Dreamseeker’s Vision of Tomorrow (Soatok)
-
Hobo Code: The Signs and Symbols Used by Travelers of Old (Joel Diffendarfer for Owlcation) / Everything You Thought You Knew About ‘Hobo Code’ Is Wrong (Maggie Downs for Atlas Obscura): How interesting!
-
Laser pointer at 2 billion fps (Alpha Phoenix)
Tech links:
-
Abstraction, not syntax (Ruud van Asseldonk)
-
A pragmatic guide to modern CSS colours - part one (Kevin Powell for Piccalilli)
-
Falsehoods programmers believe about languages (Michal Měchura)
-
Police operation/deployment. ↩︎
-
Which I would do with a face mask, of course. Not wearing one would only lead to actively infecting the people around me. I’m surely not that inconsiderate! ↩︎
-
As long as the template doesn’t change, the compiled bytecode can remain cached and thus be reused. ↩︎
-
Am I writing it like this just to show off the math support I implemented? Ehh, why would you even ask that? You sound envious. ↩︎
-
Nanoc’s
preprocessblock is a pain. It’s a hack that I could never get rid of. Thepreprocessblock is always executed, so it doesn’t benefit from Nanoc’s support for incremental builds. My new SSG will not have anything like apreprocessblock. ↩︎ -
Wolfenstein: The New Order (MachineGames, 2014), published by Bethesda Softworks. ↩︎
-
Wolfenstein II: The New Colossus (MachineGames, 2017), published by Bethesda Softworks. ↩︎