Diary 2019-04-24

By Max Woerner Chase

Working on node-graph had me thinking "I feel like my design here was way too complicated. Surely this can be done more easily." And thanks to the tests I wrote, I was able to start deleting code, until I'd excised most of the special cases that exist only to compensate for each other's existence. The code got a lot shorter, and I got inspired to make other simplifications, that ended up removing a lot of weird logic, pushing checks out of internal loops, out to the top-level interface, mostly. It's probably possible to remove more of the checks, but I don't care right now.

I'm sketching out ideas for a visitor system. It's sort of complicated, because I'm thinking up front about how to avoid recursion. Maybe I should sketch out how to avoid recursion, do an initial recursive design but with the non-recursive data types, then work on eliminating it. Or maybe it'll be easy once I have the types put together. Why don't I try that now... Hmm... Hard to say what I think about what's easy or hard, besides that "recursive but using the new classes" is probably easier than "recursive without the new classes" would be, because it means I don't need to go beyond the simple capabilities of functools.singledispatch, I think.

I've also been thinking about interactive fiction, and roughing out some ideas. I've got something that feels promising from an interaction perspective, but it's nowhere near being a rough draft yet.

One unfortunate aspect of my relationship with interactive fiction is that I haven't found an authoring tool that totally clicks with me, so I get this recurring itch to just roll my own, and the results of trying to design just a single low-level component have me intellectually convinced this is a bad idea, but that doesn't stop the urges.

I'm thinking I'll take some time later to just sketch out the logic of the visitor stuff, since this is actual new spec. I guess I'll also do the IF-related stuff, just to see if I can make a better case for "come on, don't do this" on paper than in my head.