Coding 2021-05-27
I vegged out a bunch today, so I'm just going to sketch out some quick thoughts for the whole action/target thing:
- It's probably easier to reason about Targets if they have a more restricted type, even if it is convenient to be able to pass in Paths. As such, they should be normalized internally using os.fspath() or similar.
- The actual name should just be strings; I think I want to use NewTypes in the definition of the data structures, just to make sure I don't have a type error in my own code, but the API should just use strings.
- Some of the types in the current prototype are going to be simpler than the original, because I'm planning to do more to leverage some, uh, inevitable global state.
- The big uncertainty I remember having in the first prototype revolved around mutable state. I'm generally not a fan, but some of this stuff needed to happen somehow. Also, some of this stuff is making me realize the appeal of aspect-oriented programming. Maybe this is a sign I should look into how Cement does hooks, and try to fit my desired code into that system.
I'll research that last one quickly while this posts, but I should really wrap up.
Good night.