Makefiles, UI Experiments, State Machine Formalities
Recommended Reading and Videos
UI WTF
This website contains a few different experiments in seamless UI paradigms. Implementations of mouseover link previews, Cmd+K popover menus, interactive component property tweaking, and more make this a nice site to play around with for inspiration.
Surprisingly, it's not open source, but in a way that's actually nice, since it provides encouragement to figure these things our on our own.
Natto
Natto allows you to create little Javascript snippets on a canvas that run code and send their output between each other. A fun tool to play around with, and another source of inspiration for new and fun UI behavior.
I Heart Make
A short blog post encouraging you to use make
for simple file processing scripts. It handles a lot of things that we often reimplement and just omit completely in scripts, such as running only on updated input files, subcommands, and more.
And for tasks like this it's actually not so hard to use. I wrote my first Makefile in years after reading this blog post for a task at work, and it was a great experience.
Here's the entire thing to run a script over every .pptx
file in a directory, and after the first time, only run it on new or updated files. Nice and easy!
BUILD_SCRIPT := $(shell git rev-parse --show-toplevel)/tools/generate-pptx-template/run.sh
SRC := $(wildcard *.pptx)
OUT := $(SRC:.pptx=.json)
all: $(OUT)
%.json: %.pptx
$(BUILD_SCRIPT) $< > $@
.PHONY: clean all
clean:
rm -f *.json
What I'm Working On
Lots of work still on Ergo. I rethought the actions model to a four-layer model:
Executors define the raw operations, such as "do an HTTP Request."
Actions define abstractions over executors, such as "call a Slack Incoming Webhook."
Task actions link tasks to actions, and can contain values to send to the actions.
State machines inside tasks trigger task actions, and can provide their own values to help fill in the action template.
With this change, I've been working on the template model to pass information up the stack from a state machine through to the executor. Almost there!
Other Thoughts
I saw a tweet today about how state machines make it easy to diagnose and fix bugs, and it made me realize that encoding your logic in a state machine has a lot of similarities to working in a strongly typed language. It can be more of a hassle to start out, but modifying the code or fixing bugs later can be a lot easier since more things are defined in an explicit, structured manner.
If you enjoyed this, I'd love if you share it with a friend (sign up here) or just reply to this email with your thoughts. Thanks for reading!