š inaugural microblog post! sp1'23, week 10, day 2
Inaugural microblog post (implemented today)!
breakfast: crusty bread with vegan butter and marionberry jam š¤Æš plus coffee
minimum viable code 10-11am
(reminder to my otherly-timezoned batchmates who attend my events: Iām in pacific time)
hosted MVC with 4 others in attendance. my usual format, as usual:
- greetings
- 5 minutes going around to see what weāre all planning to work on for the hour (I usually frantically come up w/ something on the spot during this time because I woke up with no plan)
- reconvene at ~45 minutes past the hour
- 15 minutes of sharing what we got done
(TODO: I need to write up a blog post or RC wiki page describing my style of running an accountability event that punchily maximizes engagement for distractible people)
continued working through rustwasm tutorial
I fixed a bug I got stuck on yesterday in my rustwasm game of life web renderer which displays in JS but interops with Rust (where the game logic runs) via WebAssembly. The game logic itself is straightforward but there are a lot of Rust subtleties in here that I definitely donāt understand, and need to go back through.
Also added a speed control and a reset button.
dev journal notes
- scattered annotated git tags through commit history so I can come back to different steps later
performance.now()
. reminder thatDate
in JS was not designed for profiling and is not considered millis-accurate.- hashlife is a memoized algorithm specifically designed to speed up computation of predictable/recurring patterns in cellular automata, using a quadtree to optimize lookup. this allows polynomial-growth patterns to be evaluated in logarithmic time. jeez. (of course, it also consumes a lot of memory, implementation complexity, and requires garbage collection. I think I want to do something with quadtrees but I probably donāt want to implement hashlife itself.)
now what
From a WASM interop perspective, here are the steps the tutorial goes through.
- Naive game of life implementation. Pass the entire game state to JS each time, just to get basic interop working.
- Pointer access into WASMās linear memory. JS holds a pointer to the spot in memory where the game state is stored. Rust modifies the state and JS peeks at the state.
- Cell state is simply true or false, so save space by switching from bytes (8 bits) to bits.
I just finished step 2 and havenāt started step 3 yet.
Unfortunately, although step 3 seems wildly useful from a learning perspective, I feel viscerally unmotivated to continue from a practical perspective because there are no true performance-pushing constraints in this toy exercise. Even the naive implementation was so blazing fast that each universe step-and-re-render is being completed in a few milliseconds, way faster FPS than my human brain is capable of perceiving, and I highly suspect the bulk of that time is on the display side. I even had to add a slider to slow down the rendering so I could perceive it.
In the interest of tricking my motivational system into wanting to do this AND going back to better understand more subtleties of the Rust code I am rather blindly using, I think it might be fun to add runtime/memory profiling and write up a comparison between the three approaches.
Then, I got distracted by a different idea: microblogging.
add a microblog to my blog
Many recursers post daily journal entries, which are cute and fun. I always feel better and more self-connected on days I remembered to write a daily checkin because it takes me from the āugh I didnāt get anything doneā mindset to the āoh shit I actually did a lot of thingsā truth.
- 11:30-11:50pm: first I go out in the warm sunshine and took a walk around the block, because the weather is too beautiful to ignore
- 12-2pm: inspired by Obsidian Daily Notes, I implement a microblog on my blog. I also decide to skip all the afternoon events I had RSVPd to.
- 2-2:15pm: late lunch, leftovers.
- 2:20-3:30pm: I write a blog post on my main blog, about implementing the microblog. Wow so meta.
- 3:30-3:50pm: ok then I slam out this microblog post because I need to have an inaugural microblog post. have I gone too far? itās blogs on blogs on blogs all the way down
in summary: 1.5 hrs of actual project code, 2 hrs of blog feature implementation, and 1.5 hrs of blogging about what I did today š¤£
fun asides
FYI, I look up emoji in my terminal via a brew
package called emojify
. Itās very satisfying. I donāt have a pipeline to get them directly into vim
though, that would be more of an emacs
power move that feels unnecessary for my desires.