Weeknotes 189
Phase transition
-
The worst of the cold symptoms cleared up quickly. The long tail was a lingering cough which, while relatively benign, did stop me from sleeping at night, and that’s not how you want the night to pan out, you know, ideally.
So the week was basically a write-off. I lay around on the sofa watching telly (see below) and trying to Lemsip–Jakemans myself back to life. I missed LRUG on Monday, and board games with Chris & Leo on Thursday, because I a) couldn’t face the stigma of Coughing In Public and b) felt pretty spaced out from lack of sleep anyway.
-
My brain kept working well enough to ship the interminable, self-inflicted refactoring of my WebAssembly interpreter. Across 87 thrilling commits:
-
I isolated some preparatory tidying of the preprocessor, parser and interpreter, ready for the real work to happen.
-
I taught the AST parser to read a complete instruction at a time instead of faking it by reading many individual atoms and squashing them all together. This didn’t particularly matter for the parser’s purposes but it set me up nicely to share the relevant code with the preprocessor.
-
So then I taught the preprocessor to read a complete instruction too. This was satisfying because it dispensed with several hacks which were making me uncomfortable, although I did spoil it by forgetting about structured instructions until it was too late. I wouldn’t have made that mistake if I’d spent another week pointlessly agonising over this change; an important lesson.
-
Hello there.
-
Finally — finally! — I desugared all remaining abbreviations in the preprocessor, including WebAssembly’s cursed and unnecessary folded instructions feature. The parser is now completely ignorant of all abbreviations, which is… I mean, it’s a bit neater, I’m glad I did it, but in hindsight it does seem like a lot of effort for the sake of a completely invisible improvement. That’s hobbies I suppose.
The point of all this is that the preprocessor can now read a program like this one (taken from Mozilla’s WebAssembly page)…
(module (global $g (import "js" "global") (mut i32)) (func (export "getGlobal") (result i32) (global.get $g) ) (func (export "incGlobal") (global.set $g (i32.add (global.get $g) (i32.const 1) ) ) ) )
…and convert it into this for the parser:
(module (import "js" "global" (global $g (mut i32))) (export "getGlobal" (func $__fresh_0)) (func $__fresh_0 (type 0) (result i32) global.get $g ) (export "incGlobal" (func $__fresh_1)) (func $__fresh_1 (type 1) global.get $g i32.const 1 i32.add global.set $g ) (type (func (result i32))) (type (func)) )
Not a huge change, but several fiddly syntactic wrinkles have been ironed out: inline imports and exports have become top-level fields; inline type uses have been replaced with references to generated type definition fields; and the folded instructions have been turned into linear instruction sequences. The resulting program is much less annoying to parse.
Now that I’ve completed this mammoth task it’s not obvious what to do next. I’d originally mooted adding
.wasm
support, so I’ll stick with that unless I think of something more fun. I probably just need a break from it first.  -
-
I’m enjoying playing a new Connections puzzle every morning, and working my way through the archives, like the basic person I am. Yeah okay but it’s good though isn’t it? Occasionally I’ll find one with exactly the right amount of ambiguity and misdirection and it’s delightful. (Conversely, they’re occasionally spoiled by a reliance on American sport.)
-
I finished season three of The Picard Gerontocracy (with accompanying reviews) and enjoyed it a lot. It was genuinely quite touching to see the old gang back together, and the show managed to give them an appropriate, heartwarming sendoff without doing anything incredibly annoying. A good final season of TNG.
-
Enough time had passed since Fishes for me to go back and finish season two of The Bear. Again: ugh! It’s perfectly written and performed and shot, and absolutely brutal, and I love it. Is there a better TV show than this? I can’t think of one.
-
I’m so accustomed to subconsciously bracing myself for everyone on TV to be left-handed that I felt palpable relief when I noticed that Sydney was writing and chopping with her right hand.
-
I rewatched Blade Runner 2049 as planned and I don’t think I liked it any more than the first time. Maybe it didn’t help that I had to break it into two halves, but after an hour and twenty minutes of it I couldn’t face another hour and twenty minutes of it straight away. Whereas Dune (2021) grabbed me enough that I had no problem watching it in one sitting despite it being almost as long.
2049 undeniably looks good, and there are a few arresting images and evocative musical cues, but it doesn’t capture the charm of the original. (Weirdly it does capture the misogyny, which is the main thing they probably should’ve ditched.) It feels weighed down by the need to connect to specific ideas and characters from the first film instead of relaxing into its universe and doing something fresh and self-contained.
It just comes across as sort of dull and unnecessary and probably would’ve worked better as a TV series than a film.
-
Since writing the above I’ve learned there’s a TV series in the works. Alright then.
-
Ignoring occasional bits and bobs to keep the lights on, it’s been a year since I stopped working full-time. It’s mostly been hundreds of days off, if I’m honest, and I feel better for it even if the water will never run clear.
I’m grateful I could afford to take that time. I don’t feel I’ve particularly missed out by doing it, although I suppose the interruption in savings and pension contributions has pushed my imaginary future retirement date back by… a year? More? How does compound interest work? Anyway.
A year ticks over, the nights begin to draw in, summer clouds condense into autumn rain. Feels like a phase transition.