Nov 19, 2022
Has anyone heard of stack people vs queue people? I don't know where I got it from, but it's been an enduring part of my self-image for a decade now that I'm a stack person.

When something new pops up, a queue continues what they were doing. A stack switches.

Obviously this is a spectrum, but I find it very easy to rationalize that the new tasks are "quick".

Anyway, being a stack is hard with a new project. Every 2 minutes I discover something broken, and now I have to resist working on it.


A minimalist DOM in 50 LoC

Notation:


A notation for a simple DOM

It's just a Lua literal, though the syntax highlighting is confusing.

Implementation:

First 2/3rds of code for rendering the DOM while saving coordinates of each rectangle.

Render:

Is there a better name for this than "DOM"? A notation for a tree of rectangles, often containing text, to be rendered to screen and united with mouse events.

Rects contain either text or rows/cols of other rects. Other attributes: fg, bg, margin. Margin is margin-top or margin-left depending on whether the rect contains rows or cols.

No inline styling yet (bold, span, etc.), that feels like a separate concern.


This is pretty surprising. (And pretty.) I'm trying to understand why my app goes unresponsive sometimes, so I added a debug dashboard. The top graph shows the memory footprint every second. The bottom shows memory footprint every 10s.


Two graphs with time on the x axis.

The top graph shows a sawtooth as the app uses more and more memory, until GC reclaims half of the peak.

The bottom graph shows a braid pattern where alternate samples (averages of 10 samples from the top graph) grow and shrink. At the extremes alternate samples seem to be off by 25% -- both before and after the GC.

Does it make sense why the top graph when averaged 10x yields the bottom?! Sure doesn't to me.

This post is part of my Freewheeling Apps Devlog.

Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.

archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)