Hi HN, author here!<p>This post is ostensibly about some tooling I’ve written to help me write posts that contain lots of code, while ensuring that the code always produces a valid source tree which matches up with where we are in the prose. This is easy when a post is small, but can become really difficult to manage with a larger piece of work!<p>The bulk of this post, though, is a proof-by-demonstration of the tooling. We implement a little 2048 clone, line by paragraph, and there’s a bunch of checkpoints interspersed throughout the post - and now we’ve implemented input handling! and now we can slide tiles around!<p>At each of these checkpoints, I’ve embedded some live visualizations of the code we’ve written so far. My hope is that the reader can really get a feel for what we’ve built so far, because they can see what works, and what doesn’t work, running right in front of them in the browser. These little computers are taken from snapshots produced by the tooling, compiled to Wasm and executing in the browser.<p>This is my first time providing this level of interactivity in one of my posts, so please do feel welcome to play around with it. I’d love any and all feedback on the experience. Thanks so much!
I made a tool to help motivate me write every day. After sharing it with some writers for their feedback, one of them had a really insightful comment: “Wow, wanna-be writers will really do anything to avoid writing!” I had spent a lot of time writing a tool to help me write when I could have been writing instead! Writing is an ancient technology. We more or less know how to do it efficiently. I think it’s important to ask ourselves why we spend time writing tools to write.
Interesting to see how the writer scratches this itch.<p>I've been managing the same basic friction with multiple incremental copies of the source files, a little shell script to generate diffs/logs/artifacts, and some make-based tooling to re-run those when sources change (and sync the outputs to a gist so that I can optionally include an instruction for obtaining the source via git). It works, but it's obviously suboptimal if I goof something and then have to make the same fix several times.